Agent pane: agents end a turn with a wrap_up next-step box (recap, question, answer buttons)

Merged
TE
2d ago
+930-31

Leo, 2026-11-03, watching Claude Code Desktop: "yo wth i want this kind of feature in cmux-next too" (the next-step box).

Builds on the tagged-ask next-step card (#33269) and the session recap row (#33162). Those read the box out of the agent's prose. This adds the typed path: the agent calls a tool, and the pane draws the box from the call's input.

What changes

  • acpmux: a wrap_up tool on every chat's acpmux MCP server (acpmux_mcp_wrap_up.rs; acpmux_wrap_up behind the folding cmux server). Input: recap (required, two or three sentences), ask (one short question, only when a decision waits on the person), actions (one or two answers, the pick first). The tool checks the input and answers what it showed. It makes no daemon request, so it works on every harness and host. The server's instructions tell Claude and Codex to call it as a turn's last step. A Chief turn's allowlist leaves it out, as it does every tool it does not name.
  • Agent pane (conversation/wrapUp.ts, turns.ts): the call reaches the transcript as an ordinary ACP tool call with typed input. A completed turn's last wrap_up call becomes its nextStep row, under the answer (or after the turn's last row when there is no answer text). The call's own tool row is dropped. A wrap-up goes before a tagged ask in the prose. A recap alone draws in every turn. A recap with a question waits on the last turn, and once a prompt follows it folds to the question and the answer, with the recap kept. Stopped and failed turns draw none, so the failed-turn card (#34306) is untouched.
  • NextStepCard: the recap, muted, at the top of the same box, then the question and the buttons. This is the reference's layout (claude/web/october-recap-card). With no question the box holds the recap alone. A click sends the answer through the existing chat.send path, and āŒ˜ā†© fires the first answer.
  • Code mode: a default chat sees only cmux_exec, so it calls cmux.acpmux_wrap_up(...) from a script. code_mode.rs keeps what the call showed in its call_log record (shown), and the pane reads the box from there (execWrapUp); a script that only wrapped up drops its row. The cmux MCP server's instructions now name the call when the acpmux upstream is present, since Claude Code sees a deferred tool's description only after a search (the instructions stay under the 2048-character cut).
  • Recap card (recap.ts): it steps aside for a turn that has a wrap-up, as it does for a tagged ask.
  • The feature is on by default. There is no setting and no Labs gate.

Design

Gallery agent-pane.next-step-wrap-up has three looks, each with two answers, yes or no, recap alone and answered:

  • box (shipped): the recap muted on top, as Claude desktop.
  • divider: a hairline between the recap and the question.
  • split: the recap as prose above a box that only asks.

I picked box because it matches the reference and keeps one surface. Mock scene: ?mock session mock-wrap-up ("Fix product grid layout shift").

Tests

  • webviews/test/agent-pane-wrap-up-card.test.tsx: tool names (Claude, folded cmux, Codex), defaults, refusals, placement under the answer, the call row dropped, the answered fold, a recap alone, no answer text, stopped and failed turns, precedence over a tagged ask, the recap card stepping aside, and card markup.
  • webviews/test/next-step-card-gallery-browser.test.ts, in Chromium: the in-pane gallery variant wrap-up-code-mode is the turn a real DEV chat recorded (call_log below). The test reads the drawn box (recap, question, two answers), clicks Yes, add README, and asserts the pane sent session/prompt with exactly that text as the next prompt.
  • cmux-tui upstream_tests.rs instructions_in_both_modes: the wrap-up line is in the code-mode instructions only with the acpmux upstream, and the total stays under 2048.
  • acpmux_mcp_wrap_up.rs unit tests, plus acpmux_mcp_tests.rs: the tool list and its instruction, and the Chief allowlist.

Observed / Not run

  • DEV build of this branch, an SR2 Claude chat: it called cmux.acpmux_wrap_up from cmux_exec, and the call_log held {"name":"acpmux_wrap_up","ok":true,"shown":{"recap":"Checked the folder: it is empty.","ask":"Should I add a README here?","actions":["Yes, add README","No thanks"]}}.
  • The click from that box to the next prompt was checked headlessly in the browser test above, not by clicking in the DEV app.
  • Fleet runs at the final head 8a78cab: the browser click test (a wrap-up answer click sends the answer as the next prompt), the wrap-up card tests and the cmux-tui upstream tests pass; clippy for cmux-tui is clean. Base reds, checked per test against the feat-cmux-next tip on the same harness: test/new-tab-live-resize.test.ts on webkit, acpmux repo_sync_tests.rs clippy, and the panic ratchet in crates this PR does not touch.
  • Follow-up filed: #34712 (Copy omits the recap).

Changelog

  • Added: agents end a turn with a next-step box: a short recap and, when a decision is yours, a question with answer buttons that send your reply.

Agent session: agent session

šŸ¤– Generated with Claude Code