Skip to content

bug(cli): TUI tool cards settle to "(no output)" and stay stuck once scrolled out of the viewport #3521

Closed

Description

@Astro-Han

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)

  1. The Runtime Host live tool_result broadcast deliberately omits content: session-continuity-coordinator.ts projects only status / durationMs (the wire type SessionToolEvent has no content field, since feat(runtime-host): add session continuity #1358), and the CLI-side adapter/session-projector.ts substitutes { kind: 'text', text: '' }. A tool card therefore settles into the (no output) placeholder the moment it completes. (packages/ui documents the same contract: "RH live tool_result deliberately omits content (empty text)".)
  2. Real content is backfilled only at turn terminal: onTurnTerminal → loadCurrentMessages → reconcileToolsWithStoredMessages. There is no mid-turn trigger — the CLI does not consume subscription.transcript_advanced frames.
  3. Entries above renderGeometry.viewportTop have 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.
  4. 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 viewportTop are 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

  1. Start a TUI session from source on main.
  2. Run a turn with enough tool calls that the earliest cards scroll out of view (a single long autonomous turn suffices).
  3. 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

Diagnosis drafted with AI assistance (Maka); mechanism verified against source and a throwaway transcript-level reproduction.

Activity

  1. added
    bug
    on Aug 22, 2026
  2. self-assigned this
    on Aug 22, 2026
  3. shaokeyibb commented on Aug 22, 2026

    @shaokeyibb
    Contributor

    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.

    // packages/runtime-host/src/adapter/session-projector.ts, projectToolEvent
    if (event.type === 'tool_start') {
      return {
        type: 'tool_start',
        ...base,
        toolName: event.toolName,
        args: undefined,          // ← alongside the content: { kind: 'text', text: '' } below

    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:

    ● Bash (no output)                    ← during the turn: no command, no result
    Bash  $ dir (1 line · 62 bytes)       ← after the turn settles: both appear at once
    

    Two details that make the live row degenerate completely rather than partially:

    • toolDurationText returns '' for a settled sub-second entry (pi-transcript-tools.ts:75). A fast command therefore contributes no duration part, so compactAnnotation'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.
    • With args: undefined there 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. reconcileToolsWithStoredMessages already restores the input alongside the result —

    // packages/cli/src/pi-transcript.ts, reconcileToolsWithStoredMessages
    entry.input = structuredClone(durable.input);
    entry.result = durable.result ? structuredClone(durable.result) : undefined;

    — 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 by subscribeTranscriptReplacements), and nothing in packages/cli/src references transcript_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.

  4. added a commit that references this issue on Aug 23, 2026
    d604987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions