Feature Request
The status bar's context usage indicator (14/200K (7%)) currently only updates after an entire task completes. During a long multi-step agent loop (LLM → tool → LLM → tool...), the context usage stays frozen, giving the user no visibility into how much context window is being consumed in real-time.
Current Behavior
- User sends a prompt → task starts
- Agent loop runs 10+ LLM calls with tool use over several minutes
- Status bar context usage stays at the value from the previous task
- Task finally completes → usage updates in one jump
Desired Behavior
Context usage updates after each LLM call within the agent loop, so the user can see context consumption growing in real-time and decide whether to intervene (cancel, compact, etc.) before hitting the limit.
Implementation Plan
Daemon side (StreamingAgentHandler / StreamingAgentLoop)
After each LLM call in the agent loop, send a notification:
{"jsonrpc": "2.0", "method": "stream.usage", "params": {"inputTokens": 42000, "outputTokens": 8000, "totalTokens": 50000}}
The inputTokens here should be the cumulative input tokens from the most recent API call (which represents current context window consumption).
CLI side (TaskStreamReader + TerminalRepl)
- Add
case "stream.usage" handler in TaskStreamReader.handleNotification()
- Update
latestInputTokens on each stream.usage notification
- Trigger
requestUiRender() so the status bar refreshes immediately
Files to modify
aceclaw-daemon/src/main/java/dev/aceclaw/daemon/StreamingAgentHandler.java — emit stream.usage after each LLM call
aceclaw-cli/src/main/java/dev/aceclaw/cli/TaskStreamReader.java — handle stream.usage
aceclaw-cli/src/main/java/dev/aceclaw/cli/TerminalRepl.java — update latestInputTokens from notification
Feature Request
The status bar's context usage indicator (
14/200K (7%)) currently only updates after an entire task completes. During a long multi-step agent loop (LLM → tool → LLM → tool...), the context usage stays frozen, giving the user no visibility into how much context window is being consumed in real-time.Current Behavior
Desired Behavior
Context usage updates after each LLM call within the agent loop, so the user can see context consumption growing in real-time and decide whether to intervene (cancel, compact, etc.) before hitting the limit.
Implementation Plan
Daemon side (
StreamingAgentHandler/StreamingAgentLoop)After each LLM call in the agent loop, send a notification:
{"jsonrpc": "2.0", "method": "stream.usage", "params": {"inputTokens": 42000, "outputTokens": 8000, "totalTokens": 50000}}The
inputTokenshere should be the cumulative input tokens from the most recent API call (which represents current context window consumption).CLI side (
TaskStreamReader+TerminalRepl)case "stream.usage"handler inTaskStreamReader.handleNotification()latestInputTokenson eachstream.usagenotificationrequestUiRender()so the status bar refreshes immediatelyFiles to modify
aceclaw-daemon/src/main/java/dev/aceclaw/daemon/StreamingAgentHandler.java— emitstream.usageafter each LLM callaceclaw-cli/src/main/java/dev/aceclaw/cli/TaskStreamReader.java— handlestream.usageaceclaw-cli/src/main/java/dev/aceclaw/cli/TerminalRepl.java— updatelatestInputTokensfrom notification