Agent chat: list each tool call under Worked for, and name MCP calls in words

Merged
TE
16d ago
+630-52

Problem

The cmux NEXT agent chat hid most of a turn's work. When you opened a finished turn's Worked for, the run between two assistant messages was still one line, "Used a tool, read a file, ran commands >". Each "Ran N commands" group was closed too, so seeing any command took two or three clicks. MCP calls showed their raw ids in the running line, for example "··· mcp__cmux-subsessions__start_session 18s".

Change

  • An opened Worked for lists each group and call on its own line, the way the Codex and Claude Code desktop apps do. The "Used tools, …" run fold now applies only when the Debug toggle codexToolRuns is on (foldRun, turns.ts codexRuns).
  • Like the Codex app, command, read and search groups list their calls flush under the line, without the tree guide. Each command row reads "Ran " (the localized tools.ranCommand) after the terminal glyph.
  • Command, read and search groups are open by default and show their last 5 calls. Earlier calls sit behind "+K more" (ToolGroupRow.tsx GROUP_TAIL), and Find opens that hidden part when it matches there. Edit groups stay closed because each one opens to a full diff. Your own open/close choices are still remembered per session.
  • Default change (the defaults guard will ask for a call owner): the Debug tunable agentPane.debug.codexToolRuns now defaults to off (AgentPaneTunables.swift). The app sent true, so in nightly a running turn still folded each finished run into "Used tools, ran commands" and showed only the newest call of the run in progress, which is the behavior Leo flagged. The toggle stays available for comparison.
  • A running turn shows its groups open as calls arrive, under "··· Working for …". A finished turn still collapses under "Worked for Xm Ys" with its divider. Neither of those changed.
  • MCP calls are described in words:
    • Finished rows: start, launch and spawn tools read "Started session sidebar-drag-bugs" (new tools.mcp.start). Unknown verbs read "Called · ".
    • The running line, the activity line, ToolRow and the permission card no longer show mcp__server__tool. They show "cmux-subsessions · start session sidebar-drag-bugs" or "cmux · list workspaces" (mcpPlainName, mcpTitleName).
    • The raw id stays available as the row's tooltip and as the first line of the opened call (.cv-mcp-call__name).

Not in this PR: the Codex-style bordered sub-step cards, the background-agent status card and the pin footer action. The cmux-subsessions cards are being built by the subsession-visibility lane on top of this PR, as a new ToolGroup type, and fall back to these labels.

Screenshots (gallery agent-pane.transcript, before = feat-cmux-next 633c661, after = this branch)

Reference: the Codex desktop app's run (public screenshot from openai/codex#37213; that report's rows lost their command text, but the structure is what we match). It shows a "Ran commands ⌄" line, then one row per call: the terminal glyph and "Ran …", flush under the line. After this PR ours lists a group the same way. Each row reads "Ran " with the command in mono, and the exit status and time sit at the right edge.

Codex desktop: Ran commands group with one Ran command row per call

Finished turn, Worked for opened (dense-ended-run)

BeforeAfter
beforeafter

Running turn (dense-live-run)

BeforeAfter
beforeafter

Verification

  • New webviews/test/transcript-density.test.tsx (4 tests) and the updated TurnRows.test.tsx pass. Commit 1 adds the tests and commit 2 adds the fix.
  • bun test over the transcript, agent-pane, thread and acpmux suites: 23 failures, the same 23 test names fail on base when files share a run. None are new.
  • tsc --noEmit is clean. vp fmt was applied. The gallery tests (43) pass.
  • Localization: two new keys, tools.more and tools.mcp.start, in all 21 locales of acpmux/Localizable.xcstrings. Non-English values are marked needs_review.

Agent session: cosmic-gray

🤖 Generated with Claude Code