Skip to content

condense ipython tool calls into a single-line summary - #193

Merged
kevinjosethomas merged 3 commits into
mainfrom
eng-4145
Jun 18, 2026
Merged

kevinjosethomas merged 3 commits into
mainfrom
eng-4145

Conversation

@kevinjosethomas

@kevinjosethomas kevinjosethomas commented Jun 18, 2026 •

Copy link
Copy Markdown
Member
  • collapses each ipython tool call to one status line — a marker, language, the leading bash command, live input/output line counts, and duration — instead of a multi-line code and output preview that was rarely informative.
  • ctrl+o still expands any call to its full code, output, and diffs.
  • conveys running/done/error through the marker and color rather than animation, so it stays cheap to render and rehydrates correctly when reattaching to a past session.

Note

Low Risk
Interactive TUI presentation and status labeling only; expand behavior and execution paths are unchanged aside from clearer done-state when rehydrating past sessions.

Overview
Collapsed IPython/bash tool calls now render as one truncated status line instead of multi-line code/output previews. The line shows a colored status glyph (✓/✗/▸), language, the leading bash command (with cd … && stripped and comments skipped), ↑/↓ line counts, duration, and error name, plus the expand key hint.

statusKind now treats a cell as done when any result exists (stdout, stderr, result, error, diffs, or content), so sessions rehydrated without a live executionStarted event no longer show running. Expanded view (Ctrl+O) is unchanged: full panel with code, output, and diffs.

Tests were updated to expect the new collapsed copy and to set expanded: true where full diff/panel output is asserted.

Reviewed by Cursor Bugbot for commit 2035cfc. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Condense collapsed IPython tool calls into a single-line status summary

  • Collapsed IPythonCellComponent cells now render a single status line instead of a multi-line preview, showing a status marker (✓/✗/▸), language (bash/python), an optional summarized bash command, input/output line counts, duration, and error name.
  • New helpers summarizeCell, collapseWhitespace, and truncateDescriptor strip magic prefixes, comments, blank lines, and leading cd … && sequences before truncating the command to fit available width.
  • statusKind normalizes cell state to a single category (done/error/aborted/running/queued); cells rehydrated with results but no live start now show done instead of running.
  • Behavioral Change: collapsed bash cells show the extracted command; collapsed python cells show only line counts with no code preview; diff cells suppress output line counts.

Macroscope summarized 2035cfc.

@linear

linear Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
ENG-4145 Condense tool calls into main semantic values

Right now, we show collapsed versions of the IPython blocks by default, which shows 3-4 lines of the input and output to the user. At any time, users can hit ctrl+o to expand all blocks and see all the code within these. The line limit is great, but this is inherently not so useful as you cannot extract meaningful data from just 1-2 lines of input and output, especially when one line is often just %%bash.

We're considering doubling down and simplifying the UI so we don't render these blocks at all, and instead have a single descriptive line for each tool call, and users just hit ctrl+o if they actually want to see what these tool calls are.

It would be incredibly cool to have natural language semantic summaries of each tool call. For example, Vercel's v0 shows "Read particles file" "Removed hover interaction" "Removed event listeners", etc, for each tool call, which can then be expanded to see the actual tool call block. Albeit this idea might be slow and token expensive with tool calls, so we can avoid that unless you think it's feasible. So instead, if that isn't possible, we can simplify it to be a single line with different states. For each IPython block, we can simply show a line with an animated ascii icon to the left and then basic information, similar to our current "Working", "Waiting", "Writing code", etc animation.

The main things we should show are python/bash, main commands being run if possible (like git, sed, or whatever is being written— unsure what we can do for python code here though), number of tokens, time, and any other interesting ideas

Review in Linear

@kevinjosethomas
kevinjosethomas merged commit 6be4a20 into main Jun 18, 2026
3 checks passed
@kevinjosethomas
kevinjosethomas deleted the eng-4145 branch June 22, 2026 18:38
zhengr pushed a commit to zhengr/prime-agent that referenced this pull request Aug 8, 2026
…t-ai#193)

* condense ipython tool calls into a single-line summary

* trim comments

* update ipython cell tests for single-line collapsed view
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