fix(tui): name committed tool rows with the shared display-name map - #3
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A resumed session named a
run_codecall by its wire name —run_code (…)— where a live session showedRun 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 onlyInvokeDeferredTool. Everything else,run_codeincluded, fell back to the wire tool name.The authoritative decision is
streaming_tool_display_nameincrates/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
HashMapone (streaming tool input) and a newstreaming_tool_display_name_for_valuefor callers holding the input as aserde_json::Value(the transcript projection). One match, two ways in — no second copy.Behaviour change carried along
A committed
Agentrow now shows its subagent type, exactly as the streaming card already did.crates/rebon-tui/src/render/tests/thinking.rsasserted the oldAgent (name; it now assertsExplore (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 arun_codetool use and asserts the row containsRun sequence (and notrun_code (.cargo test -p rebon-cli --locked: passed.rustfmt --checkon the three changed files: clean.Note
This does not change how much of a
run_codebody is shown. Verbose still renders the full program; the truncation andCtrl+Oaffordances remain Compact/Normal only, asrun_code_completed_preview_is_bounded_and_expansion_preserves_every_blockrequires.