Skip to content

fix(tui): name committed tool rows with the shared display-name map - #3

Merged
Quorafind merged 2 commits into
mainfrom
fix/committed-tool-display-name
Sep 22, 2026
Merged

Quorafind merged 2 commits into
mainfrom
fix/committed-tool-display-name

Conversation

@Quorafind

Copy link
Copy Markdown
Collaborator

What

A resumed session named a run_code call by its wire name — run_code (…) — where a live session showed Run sequence (…). Same turn, two names, depending on whether it was rendered live or replayed.

Root cause

crates/rebon-tui/src/render/projection.rs (the bridge the committed/replayed path goes through) kept its own copy of the tool display-name decision, and that copy special-cased only InvokeDeferredTool. Everything else, run_code included, fell back to the wire tool name.

The authoritative decision is streaming_tool_display_name in crates/rebon-render/src/summary.rs, which is what the live card uses — that is why its assertions live in the streaming tests (crates/rebon-tui/src/render/tests/tool_cards.rs, Run sequence (Inspect tasks)).

Change

The shared decision now takes a key lookup, and two thin entries feed it: the existing HashMap one (streaming tool input) and a new streaming_tool_display_name_for_value for callers holding the input as a serde_json::Value (the transcript projection). One match, two ways in — no second copy.

Behaviour change carried along

A committed Agent row now shows its subagent type, exactly as the streaming card already did. crates/rebon-tui/src/render/tests/thinking.rs asserted the old Agent ( name; it now asserts Explore ( with a comment saying why. This is the same inconsistency as the reported one, just for the other branch of the same map.

Verification

  • cargo test -p rebon-render --locked --lib: 671 passed.
  • cargo test -p rebon-tui --locked --lib: 1239 passed, including a new test that commits a run_code tool use and asserts the row contains Run sequence ( and not run_code (.
  • cargo test -p rebon-cli --locked: passed.
  • rustfmt --check on the three changed files: clean.

Note

This does not change how much of a run_code body is shown. Verbose still renders the full program; the truncation and Ctrl+O affordances remain Compact/Normal only, as run_code_completed_preview_is_bounded_and_expansion_preserves_every_block requires.

The transcript projection carried its own copy of the tool display-name
decision, and that copy knew only about `InvokeDeferredTool`. Every
committed row therefore named a `run_code` call by its wire name, while
the streaming card called the same call "Run sequence", so one turn read
differently before and after `--resume`.

Ask the shared map instead: `streaming_tool_display_name_for_value` is
the `serde_json::Value` entry to the single decision in `summary.rs`,
which now holds the match and takes a key lookup so both entries share
it.

One behaviour changes with the consolidation: a committed `Agent` row
now shows its subagent type, exactly as the streaming card already did.
The thinking test that pinned the old name is updated to the shared one.
@Quorafind
Quorafind merged commit 7eb4359 into main Sep 22, 2026
9 checks passed
@Quorafind
Quorafind deleted the fix/committed-tool-display-name branch September 22, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant