Agent chat: a run of tool calls between messages collapses to one quiet line

Merged
TE
13d ago
+456-47

Leo-ask: ask-ef75b49339

Leo, 2026-10-22, on Codex's transcript: "this is pretty good ui: … the collapsing i mean"

A run of tool calls between messages now collapses to one quiet summary row, including edits: “Edited 2 files, read 2 files, ran 2 commands.” Click it to expand the existing tool rows. The line names kinds of work in first-occurrence order; edits use the pencil, otherwise the most frequent kind supplies the glyph.

Running calls remain on the live line. Background calls spin the summary glyph, failures are counted, coordination cards remain visible, and file changes awaiting permission stay expanded. The ended turn’s edited-files card remains available.

The app dispatches shaped tool runs to the tool-row renderer, including runs with edits, and estimates their collapsed height as one line. A regression caught the previous dispatch to the edited-files card, which hid the summary in the real gallery despite isolated component tests passing.

Gallery and reference

Reference: Codex codex-collapsed-tools.png supplied with Leo’s ask; reviewed the private cmux-design-references README and Claude/Codex live notes.

Four gallery looks are retained: collapsed-run (selected default: main-kind glyph and settled-row color), collapsed-run-pencil, collapsed-run-quiet, and collapsed-run-quiet-pencil. The default keeps the reference’s quiet mixed-work pencil row while retaining the existing counts and disclosure affordance. collapsed-run-open and collapsed-run-failed cover interaction/failure states.

Gallery before/after (synthetic fixtures, private tailnet).

No capture: no native UI changed. The shared theme additions only carry the gallery-only look key; screenshot evidence is from the actual webview gallery.

Synthetic gallery captures (the supplied private reference is not published):

Before routing repairSelected default after repair
Before: edited-files cardAfter: collapsed tool run

Expanded tool run

Before: gallery health run 39901128946, rendered revision 162bffccbd86. After: gallery health run 39906123591, rendered test merge f47c0b10b1af whose parents include this PR head a06683027ea2. Source: src/agent-session/acpmux/conversation/transcript.gallery.ts. The expansion play passed with 0 layout shift and no anchor movement.

Performance

No new O(rows) work per token. Summary categories/counts, main glyph, failures and running state are memoized by the run’s items. Existing row memos and turn shaping preserve settled rows. Row dispatch adds a constant-time flag check. No timers, observers or animation loops are added; expansion uses the existing motion-gated fold.

Verification

  • Regression commit 99e6b72282d: focused collapsed-run test fails because app dispatch classified the mixed run as an edited-files card.
  • Repair: the same test passes, including the one-line height estimate and permission row visibility.
  • Huge-blue at a06683027ea2: CMUX_BROWSER_TESTS=1 bun test for collapsed runs, consolidated runs, live runs, Codex toggle and adopted replay: 30 passed, including both real Chromium replay tests. A separate focused disclosure run passed 29 tests.
  • Web lint --new-only: passed; inherited formatting findings are identical to base. Type checking and changed-file formatting/lint pass.
  • Pre-push static gate: no new violations.

Observed / Not run

Final exact-head browser/gallery and independent review receipts are recorded in the PR comments. No Swift source changed and no native build was run.

Changelog

  • Changed: consecutive tool calls between messages collapse into an expandable summary naming the work, including file edits.

Agent session: cmux16