cmux-next agent pane: Codex turn shape (Worked for fold, tool rows, footer)
Merged
TE
1mo ago+812+812+012345678901234567890123456789-169-169-012345678901234567890123456789
Part of the cmux-next parity work listed in #16174 (comment).
Stacked on #16602 (Markdown), which is stacked on #16598 (browser harness). Retarget to feat-cmux-next as those merge.
Problem
The pane drew every turn flat: the commentary, each tool call, the answer and a separate summary line, all at the same weight. Codex folds the work of a finished turn away and lets the answer lead.
Change
- A completed turn folds its commentary and tool calls under one muted disclosure line,
Worked for 15s 路 1 tool call >. That is Codex's "Worked for" line with the call count added, so the footer doesn't need a second summary line. The duration runs to the answer's first text, as Codex measures it. A cancelled turn readsYou stopped after 12s. - Opening the disclosure shows the work in place. Tool rows use Codex's glyphs by ACP kind (read, edit, search, execute, fetch, other). A row with output toggles it open.
- The answer follows the fold, then the turn's edited-files card, then a quiet footer with a copy button (28px target), a failure note when the turn failed, and the time.
- A running turn shows its work as it happens. It folds only once the turn summary arrives.
- The pass is pure (
conversation/turns.ts,turnView(rows, expanded)), so the virtual transcript still lays out one row per entry and the reducer indirect.tsis unchanged. Edit rows copied into the open fold get a:foldid suffix, so the card keeps the original row. - Every color is a
color-mixof the theme foreground, as in #16602. Nothing is hard-coded.
Verification
bun run typecheck,bun run lint:ci: exit 0.bun test src/agent-session/acpmux: 125 pass.conversation/turns.test.tscovers fold, open, running, no work, no answer, pre-prompt rows, stopped, and durations../scripts/cmux-next/build-agent-pane-web.sh --check: exit 0.- Harness (
bun run compare:agent-pane, specimen-complete): 2.505% to 2.499% mismatch at threshold 0.1. I also checked the opened fold in the harness. - Not yet verified in a fleet build. The capture will be posted here and on #16541.
馃 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Part of the cmux-next parity work in #16174: a finished turn now folds its commentary and tool calls under one muted Worked for 15s 路 1 tool call disclosure, letting the answer lead.
- Tool rows inside the open fold draw by ACP kind with Codex's glyphs, and rows with output toggle it open; the answer is followed by the edited-files card, then a footer with copy, a failure note, and the time.
- Running turns keep their work visible as it happens and fold only when the summary arrives; a prompt sent while one runs (or refused) waits after it, and rows after a summary still draw.
- The pass is pure (
turnView), so the virtual transcript still lays out one row per entry; folded edit copies get a:foldid suffix so the card keeps its original row. - The fold line and footer track what they draw so memoized rows never go stale, the height estimator knows the fold line and tool rows, and focus rings sit inside the row since its paint is clipped.
- The Markdown merge conflict is resolved by keeping both lanes: the folded turn rows and the session sidebar layout.