-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When the assistant writes text → calls a tool → writes more text, the TUI initially shows the full streamed response correctly. But when the response finalizes, the displayed text gets replaced with a shorter version — the pre-tool-call text disappears.
Steps to reproduce:
- Open openclaw tui
- Ask something that triggers tool calls mid-response (e.g. a question requiring web search + explanation)
- Watch the streamed text — it's correct and detailed
- On finalize, the text is replaced with a shorter version (pre-tool text lost)
Expected: Finalized text matches the full streamed text.
Actual: Finalized text drops content written before tool calls.
Analysis: Traced through the TUI source:
- tui-event-handlers.ts calls streamAssembler.ingestDelta() on deltas (correct, accumulates all text blocks)
- On final, calls streamAssembler.finalize() which rebuilds from the final message payload
- The final chat event's message appears to contain fewer text content blocks than what was streamed —
specifically, text blocks written before tool calls seem to be dropped from the final payload - The TUI rendering (chat-log.ts, tui-stream-assembler.ts) is correct — it faithfully displays whatever it
receives. The issue is upstream in how the chat final is assembled after multi-block tool-use turns.
Environment: macOS, Node v25.6.0, anthropic/claude-opus-4-6, terminal TUI
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working