feat: rework the TUI transcript into collapsible episodes - #217
Open
arelchan wants to merge 1 commit into
Open
Conversation
Group every model call into one episode (its reasoning, narration and tools)
and render a turn as a flat stream of steps instead of interleaved thinking
blocks and tool lines.
Rendering:
- A step with no narration collapses to one summary line ("reasoning for 8s,
read 2 files"); a narrated or running step shows a reasoning fold, the
narration as prose, then its tool rows.
- Reasoning expands while it streams and folds once the step produces anything
visible (narration, a tool, or the answer text).
- A run of same-name calls renders as a tree with one header and a child row
per call.
- In-flight tools report elapsed time; finished ones keep their measured span.
- Rows are bound to the transcript width and clipped with an ellipsis, so long
details no longer overflow the container and soft-wrap.
Tool display contract:
- Tool.display_call and the new ToolResult keep the model-facing text separate
from what the transcript shows. ask_user now renders its question and the
answer instead of a raw arguments blob, pairing each question with its answer
when several are asked at once.
- Tools with no explicit verb derive a readable one from their own name, so a
newly added tool renders sensibly without touching the table.
- The call preview picks the query, question or command out of the arguments
rather than the first value, which could be a numeric flag.
Also:
- Episodes are now the default transcript style; "/transcript legacy" stays as
an escape hatch.
- An interrupt commits the collapsed episode view instead of dumping the raw
expanded segments.
- The virtual-height estimate accounts for episode rows; without it the
transcript reserved too few rows and left stale cells on screen.
- Markdown table columns fit the available width with CJK-aware clipping.
- The deep-research offer states that a regular search is the user's chosen
path, not a failure, so the model stops narrating it as a fallback.
Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com>
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.
Summary
Reworks the TUI transcript so a turn reads as a sequence of steps instead of
interleaved thinking blocks and tool lines. Every model call becomes one
"episode" holding its reasoning, narration and tools.
Rendering
read 2 files"); a narrated or running step shows a reasoning fold, the
narration as prose, then its tool rows.
visible (narration, a tool, or the answer text).
call, so a burst of parallel searches no longer fills the screen.
the bound, long details overflowed the container and the terminal soft-wrapped
them, which looked like stray blank lines and edge-cut text.
Tool display contract
Tools now own how they appear.
Tool.display_calland the newToolResult(
model_textplus optionaldisplay_text) separate what the model reads fromwhat the transcript shows:
ask_userrenders its question and the answer instead of a raw argumentsblob, pairing each question with its answer when several are asked at once.
newly added tool renders sensibly with no changes to the verb table (it is an
overrides list, not a required registry).
instead of the first value, which could be a numeric flag.
Also
/transcript legacystays as anescape hatch and the legacy path is untouched.
expanded segments.
transcript reserved too few rows and left stale cells on screen.
path, not a failure, so the model stops narrating it as a broken fallback.
Type
Verification
New tests cover the episode commit path (including interrupt), the tool summary
and verb fallback, the argument preview, and the rendered layout.
Risk
The wire gains one optional
tool.startfield (display); older payloadswithout it fall back to the generic preview.
executemay now return either astring or a
ToolResult, so existing tools are unaffected. Rollback is/transcript legacyfor the view, or reverting this commit.Known follow-ups, not addressed here: occasional screen garbling seen when
messages are queued (root cause not yet identified), and
web_searchbeingregistered even without an API key.
Related Issues
N/A