Repository navigation
Description
What happened
In the TUI, every settled tool card renders its compact row with the (no output) placeholder (e.g. ● Skill (no output)), and expanding the card shows no result body. Cards still inside the live viewport recover when the turn terminates, but any card that scrolled above the viewport before turn end keeps (no output) permanently. Ctrl+O / Ctrl+T only retarget roughly the last screenful of entries; earlier cards can be neither expanded nor collapsed.
Expected: a settled tool card shows its real outcome summary, and Ctrl+O reveals the result, regardless of where the card sits in the transcript.
Root cause (diagnosis on main @ 1ddbd25)
- The Runtime Host live
tool_resultbroadcast deliberately omits content:session-continuity-coordinator.tsprojects onlystatus/durationMs(the wire typeSessionToolEventhas no content field, since feat(runtime-host): add session continuity #1358), and the CLI-sideadapter/session-projector.tssubstitutes{ kind: 'text', text: '' }. A tool card therefore settles into the(no output)placeholder the moment it completes. (packages/uidocuments the same contract: "RH live tool_result deliberately omits content (empty text)".) - Real content is backfilled only at turn terminal:
onTurnTerminal → loadCurrentMessages → reconcileToolsWithStoredMessages. There is no mid-turn trigger — the CLI does not consumesubscription.transcript_advancedframes. - Entries above
renderGeometry.viewportTophave frozen renders (fix(cli): freeze off-screen entry renders to prevent scrollback-clearing redraws #1139): reconciliation updates entry state but cannot rewrite lines already in terminal scrollback, so scrolled-off cards keep(no output)forever. - Ctrl+O / Ctrl+T are viewport-anchored by design (fix(cli): anchor Ctrl+O/Ctrl+T expansion to the live viewport so toggles never clear scrollback #1130): only entries at or after
viewportTopare retargeted, so the stuck cards can be neither expanded nor collapsed. A card that scrolled away while expanded stays expanded.
Reproduced with a scratch transcript test driving the exact live sequence (live tool_start + content-less tool_result → advance viewportTop → turn-terminal reconcile): in-viewport cards recover (e.g. (1 line · 9 bytes)); scrolled-off cards stay (no output) and ignore toggles.
How to reproduce
- Start a TUI session from source on main.
- Run a turn with enough tool calls that the earliest cards scroll out of view (a single long autonomous turn suffices).
- Observe: settled cards read
(no output); after the turn completes, only the last screenful populates; Ctrl+O/Ctrl+T do not affect earlier cards.
Environment
- Maka commit: 1ddbd25 (main, 2026-08-22)
- Surface: TUI / CLI
- OS: macOS
Fix directions
- CLI-side (smallest): reconcile on tool settle instead of only at turn terminal — consume
subscription.transcript_advanced(or debounce on livetool_result) and page the durable transcript forward with the existingloadTranscriptPage, reusingreconcileToolsWithStoredMessages. This narrows the broken window from "rest of the turn" to the debounce interval, so content lands before cards scroll into frozen scrollback. - Protocol-side (larger): carry bounded content in the live
tool_resultbroadcast. The omission was deliberate (feat(runtime-host): add session continuity #1358); reversing it is a public architecture decision affecting every client. - The viewport-anchored toggles (fix(cli): anchor Ctrl+O/Ctrl+T expansion to the live viewport so toggles never clear scrollback #1130) are a deliberate tradeoff against scrollback-clearing full redraws (fix(cli): expanding an off-screen block triggers a full redraw that clears pre-Maka scrollback #1097). Once content arrives before scroll-off, the remaining limitation is expansion state only; a true "expand everything in scrollback" would require accepting a full redraw.
Diagnosis drafted with AI assistance (Maka); mechanism verified against source and a throwaway transcript-level reproduction.
Activity
feat(runtime-host): carry args and settled content in live tool events
feat(runtime-host): carry args and settled content in live tool events
shaokeyibb commentedon Aug 22, 2026
Ran into this from the TUI and landed on the same projector. One thing worth adding to the diagnosis: the live broadcast drops the tool's arguments as well as its result, in the same function.
So a settled card is missing both halves of
● Name target (annotation)until the turn-terminal reconcile, not just the annotation. Observed sequence for a quiet, fast command:Two details that make the live row degenerate completely rather than partially:
toolDurationTextreturns''for a settled sub-second entry (pi-transcript-tools.ts:75). A fast command therefore contributes no duration part, socompactAnnotation's!(summary.placeholder && parts.length > 0)guard does not suppress the placeholder — the row is exactly● Bash (no output), with no(0s)to hint that anything ran.args: undefinedthere is no input summary either, so for quiet commands the row carries no identifying information at all.Good news for the CLI-side direction you list first: it needs no extra work to cover the args half.
reconcileToolsWithStoredMessagesalready restores the input alongside the result —— so moving reconciliation off the turn-terminal trigger fixes both symptoms with one change. Confirmed there is exactly one call site today (
pi-tui-runner.ts:520, driven bysubscribeTranscriptReplacements), and nothing inpackages/cli/srcreferencestranscript_advanced.For contrast, the desktop projection already defends against the content omission explicitly —
packages/ui/src/live-turn-projection.ts:420: "RH live tool_result deliberately omits content (empty text). Do not wipe …". The TUI reducer has no equivalent guard, which is why the same wire contract reads as a regression only here.Reproduced on Windows 11 and under WSL, on
main@3ab0605b3. Not filing anything separate for the args half since it is the same projection and your fix directions cover it; flagging it so it does not fall out of scope. Happy to leave it with you.Investigated with AI assistance (Claude Code); mechanism verified against source.
fix(cli): reconcile tool results while turns are live (apache#3524)