openclaw - 💡(How to fix) Fix feat(tui): clarify session state labels — distinguish Idle, Generating, Working, and Waiting states [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56856Fetched 2026-04-08 01:46:49
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Identified during a live session where a subagent was running for ~2h and the operator had no way to tell from the TUI whether the agent was active or stuck.

Root Cause

Identified during a live session where a subagent was running for ~2h and the operator had no way to tell from the TUI whether the agent was active or stuck.

RAW_BUFFERClick to expand / collapse

Problem

The TUI currently shows "Streaming | Connected" for multiple distinct session states, making it impossible for operators to tell whether the agent is actually working or just idle with an open WebSocket.

Observed in practice: after a sessions_yield call (agent yielded waiting for a subagent to complete), the TUI showed "Streaming | Connected" for ~1h45m with no visible indication that the session was in a passive wait state — not actively generating.

Proposed State Labels

Replace the single "Streaming | Connected" label with distinct states:

Actual conditionProposed TUI label
Model actively generating tokensGenerating | Connected
Session idle, WebSocket openIdle | Connected
Subagent running, parent yielded/waitingWaiting | Connected
Active work in progress (non-streaming, e.g. tool calls in flight)Working | Connected
WebSocket dropped, attempting reconnectReconnecting...
No active session / gateway unreachableDisconnected

Key Distinctions

  • Idle vs Generating: most important single change. An idle connected session and an actively generating one look identical today.
  • Waiting (yielded): when an agent calls sessions_yield after spawning subagents, the parent session is not streaming — but it is also not idle. It is passively waiting for a child completion event. This state has no current representation.
  • Working: covers cases where the agent is running tool calls, shell commands, or other non-streaming activity — the model has responded but execution is still in progress.

Acceptance Criteria

  • "Streaming | Connected" is replaced with specific labels per the table above
  • Yielded/waiting-for-subagent state is visually distinct from idle
  • Active token generation is visually distinct from idle connected state
  • Reconnecting state is visible and distinct from disconnected

Context

Identified during a live session where a subagent was running for ~2h and the operator had no way to tell from the TUI whether the agent was active or stuck.

extent analysis

Fix Plan

To address the issue, we need to update the TUI to display distinct labels for different session states. Here are the steps:

  • Update the session state machine to track the following states:
    • Generating
    • Idle
    • Waiting
    • Working
    • Reconnecting
    • Disconnected
  • Map these states to the proposed TUI labels:
    • Generating -> Generating | Connected
    • Idle -> Idle | Connected
    • Waiting -> Waiting | Connected
    • Working -> Working | Connected
    • Reconnecting -> Reconnecting...
    • Disconnected -> Disconnected
  • Update the TUI to display the corresponding label based on the current session state

Example code snippet in Python:

# Define the session states
SESSION_STATES = {
    'generating': 'Generating | Connected',
    'idle': 'Idle | Connected',
    'waiting': 'Waiting | Connected',
    'working': 'Working | Connected',
    'reconnecting': 'Reconnecting...',
    'disconnected': 'Disconnected'
}

# Update the session state machine to track the new states
class Session:
    def __init__(self):
        self.state = 'disconnected'

    def update_state(self, new_state):
        self.state = new_state

    def get_tui_label(self):
        return SESSION_STATES[self.state]

# Example usage:
session = Session()
session.update_state('generating')
print(session.get_tui_label())  # Output: Generating | Connected

Verification

To verify the fix, test the TUI with different session states and ensure that the correct label is displayed. For example:

  • Start a new session and verify that the label is Generating | Connected when the agent is actively generating tokens.
  • Yield the session and verify that the label changes to Waiting | Connected.
  • Disconnect the session and verify that the label changes to Disconnected.
  • Reconnect the session and verify that the label changes to Reconnecting... and then Idle | Connected when the connection is established.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING