Transcript: a run of agent messages folds into one line

Merged
TE
4d ago
+657-16

Leo, 2026-11-01, on a turn of "Sent to" rows, a read, another agent's line, a compaction and "Ran a command, read a file", each on its own row:

this should be collapsible

What changed

Where a turn's runs fold (Claude's per-run folding from #30176, and the Codex-style runs inside an open "Worked for" or a running turn), a run of rows that carries a message between agents now folds under one line, the way a run of tool calls folds into "Ran N commands":

  • What joins: consecutive folded tool runs (their sends included), another agent's one-line messages (received and inbox lines, not ones still waiting), and compactions between them. A run joins when it carries at least one message and draws two or more lines. Prose, a steer, a sub-session or dispatch card, an edit waiting for permission, and the live line all end it. A run with no message keeps its "Ran N commands" line, and a lone send keeps its own row.
  • Line: the folded tool run's anatomy (ToolRun.tsx): the envelope in the icon column (a spinner while a call in it runs), the summary, a failure count, and the chevron, which lights on hover or while open. It sits on the one-line pitch. The summary reads like a tool run's: "Sent 6 messages, read 3 files, ran a command, received a message".
  • Open state: closed by default. Opening it draws every row as before, each message on its own row, so #29800's "render them all separately" still holds when open. The line is a fold in the transcript's fold set, keyed by its first row's id, like a background turn's line. Its rows draw after it as rows of their own while it is open, so each keeps its estimate, the closed line is lineRow(), and the scroll doesn't jump. Find, message links and tool-row links open it (hiddenRowFold).
  • Compaction folds with the work, not as a boundary: the spec already says a finished turn folds "compaction and subagent/system notices" with its work (Leo, 2026-10-21). A boundary there would also split one stretch of coordination into two lines.

Files: conversation/messageRuns.ts (the pass), MessageRunLine.tsx (the line), turns.ts (applied in shapedTurn where runs fold, with the open state in the turn cache key), model.ts (MESSAGE_RUN is a line row and a status row, with its estimate), toolRunSummary.ts (toolRunPhrases split out), App.tsx / ChatFindScope.tsx (registry entry and reveal), and 4 new strings in 21 locales.

Not touched: the link chip colours, the prompt bubble spacing, and MessageGroupHead (sibling helpers own those).

Design spec: leo-workspace design/chat-transcript.md, new "Message runs" section (spec PR linked in a comment).

Gallery: agent-pane.message-runs has folded (shipped default), open (play clicks the line), running, and codex (inside an open Worked for).

Tests

webviews/test/transcript-message-runs.test.ts, run with cmux-ci test -- bash -c 'cd webviews && bun install --frozen-lockfile; bun test test/transcript-message-runs.test.ts':

  • Red on base at 40749c6d (test commit only): 6 fail, 1 pass. The passing case is "a run with no message, and a lone send, keep drawing as before".
  • Green at the head: 7 pass. They check that agent-message and subagent-report rows and the compaction join the run's group instead of breaking it, that the line opens to the same rows in order, the summary wording, running and Codex turns, that runs with no message and lone sends are unchanged, and that the closed line's estimate equals a one-line run's.

Observed / Not run

  • Observed: bun run check on the fleet: Oxlint 0 errors, type check clean, fmt clean. check:design-tokens fails identically on base 19faa28a. The rowEstimates, conversation/* and test/transcript-* suites fail on exactly the same 14 tests at base 19faa28a (browser-layout tests plus BackgroundMark "Open in terminal"), so none of those reds is this PR's own.
  • Not run: the gallery capture and the Find/link reveal in a real DEV build.

Changelog

  • Changed: A run of messages between agents in a transcript (sends, received lines, the commands around them) folds into one line, like a run of tool calls, and opens to every message.

Agent session: agent session

šŸ¤– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Folds a run of transcript rows that carries messages between agents (sends, another agent's one-line messages, and the compactions between them) into one collapsible line, like a run of tool calls folds into "Ran N commands".

  • The closed line reads "Sent 6 messages, read 3 files, ran a command, received a message"; opening it draws every row as before, each message on its own row.
  • Prose, a steer, a sub-session or dispatch card, an edit waiting for permission, and the live line end a run; runs without a message and lone sends draw as before.
  • Find, message links, and tool-row links open the line, and a compaction folds with the work it belongs to instead of splitting the run.
  • Find and links open a closed "Worked for" and the message run inside it together; a run holding an edit that awaits permission never folds under the line.
  • Applies where a turn's runs fold: Claude's per-run folding and Codex-style runs inside an open "Worked for".