openclaw - 💡(How to fix) Fix Feature Request: TUI should show working/busy status when agent is executing tool calls [2 comments, 3 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#48822Fetched 2026-04-08 00:52:07
View on GitHub
Comments
2
Participants
3
Timeline
2
Reactions
0
Timeline (top)
commented ×2

Code Example

user sends message
  → status: connected | working  (agent starts processing)
[tool calls happen... status stays working]
  → agent starts streaming text reply
  → status: connected | responding
  → reply complete
  → status: connected | idle
RAW_BUFFERClick to expand / collapse

Problem

When the agent is actively processing (reading files, running commands, making API calls, etc.), the TUI status bar shows connected | idle. This gives the user no visibility into whether the agent is still working or has stalled.

The agent can be busy for 10-30+ seconds executing tool calls before producing a text response, during which the TUI appears idle. Users cannot distinguish between:

  1. Agent is actively working on a multi-step task
  2. Agent has stalled or disconnected

Expected Behavior

TUI should display a working or busy state when the agent has pending/active tool calls:

  • connected | working — agent is executing tool calls (reading, writing, running commands, etc.)
  • connected | thinking — agent is generating a response (if distinguishable)
  • connected | idle — agent is genuinely idle, waiting for input

Suggested Implementation

The TUI already receives streaming events from the gateway. Tool call lifecycle events (tool_call_start, tool_call_end) could be used to toggle the status indicator:

user sends message
  → status: connected | working  (agent starts processing)
  → [tool calls happen... status stays working]
  → agent starts streaming text reply
  → status: connected | responding
  → reply complete
  → status: connected | idle

Environment

  • OpenClaw version: 2026.3.13 (61d171a)
  • Runtime: macOS Darwin 25.2.0 (arm64)
  • Channel: webchat / TUI (openclaw-tui)

extent analysis

Fix Plan

To address the issue, we need to update the TUI status bar to reflect the agent's state based on tool call lifecycle events. Here are the steps:

  • Update the TUI to listen for tool_call_start and tool_call_end events from the gateway.
  • When a tool_call_start event is received, update the status bar to connected | working.
  • When a tool_call_end event is received, check if there are any pending tool calls. If not, update the status bar to connected | idle.
  • If the agent starts streaming a text reply, update the status bar to connected | responding.

Example Code

import enum

class AgentStatus(enum.Enum):
    IDLE = "connected | idle"
    WORKING = "connected | working"
    RESPONDING = "connected | responding"

class TUI:
    def __init__(self):
        self.status = AgentStatus.IDLE
        self.pending_tool_calls = 0

    def on_tool_call_start(self):
        self.pending_tool_calls += 1
        self.status = AgentStatus.WORKING

    def on_tool_call_end(self):
        self.pending_tool_calls -= 1
        if self.pending_tool_calls == 0:
            self.status = AgentStatus.IDLE

    def on_streaming_text_reply(self):
        self.status = AgentStatus.RESPONDING

    def update_status_bar(self):
        # Update the status bar with the current status
        print(self.status.value)

# Example usage:
tui = TUI()
tui.on_tool_call_start()  # connected | working
tui.on_tool_call_end()   # connected | idle
tui.on_tool_call_start()  # connected | working
tui.on_streaming_text_reply()  # connected | responding
tui.on_tool_call_end()   # connected | idle

Verification

To verify the fix, test the TUI with different scenarios:

  • Send a message and verify that the status bar updates to connected | working.
  • Wait for the agent to finish processing and verify that the status bar updates to connected | idle.
  • Send a message that triggers a tool call and verify that the status bar updates to connected | working and then connected | responding when the agent starts streaming a text reply.

Extra Tips

  • Make sure to handle edge cases, such as multiple tool calls in parallel or tool calls that fail.
  • Consider adding a timeout to update the status bar to connected | idle if the agent takes too long to respond.

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