cmux NEXT: a background task finishes on its own Ran row; bottom notices are one quiet line
A background shell ended with a second row under its call ("Background task finished: export PATH="/Applications/cmux NIGHTLY.app/…"; B=…"), and a turn's bottom read as a mishmash: a long "Claude Code 2.1.305 · claude-opus-5-5 · through sr2 · /private/tmp/…" line, then a three-sentence compaction paragraph, then the raw command.
Now:
- A background shell's state goes on its call's Ran row (
direct.tsmarkBackgroundCall). acpmux'sbackground_task_updatecarries the Bash call's tool call id;runninggives the row the running mark (tooltip "Running in background"), andcompleted/failed/stoppedturn it into a check with the shell's whole run time, "Failed", or "Stopped" (the agent's reason on hover). This works in a group (CommandRow) and on a lone row (ToolRow), and in whichever turn the end arrives: the earlier turn's activity row gets a new version, soturns.tsreshapes that turn and the memoized row redraws. A laterunningnever revives an ended shell, and the call's own result keeps the state (Ctrl-B or Claude's auto-background sendrunningbefore the call returns). - A shell whose call is not loaded is still one row, but its command is cut to the working step (
shortCommand.ts: dropsexport/cd/assignments, names the program by its basename, adds an ellipsis): "Background task finished: cmux browser open https://example.com". The whole command shows on hover. When an older page brings the call, the end moves onto the call's row and the separate row goes (both the rebuild path andfoldOlder). - Session start is one line: "Claude Code · Opus 5.5 · sr2" (no route for the person's own setup). The full facts (version, model id, route, folder) show on hover and open below on a click.
- The compaction notice is one line: "cmux manages compaction · Learn more" (or "Claude Code compacts on its own · Learn more"), the same height and quiet style as tool rows, with its dismiss X. Learn more opens the old paragraph.
- The summary reads background ends from the call rows too, so a finished shell doesn't read as still running there.
The bottom-of-turn tray for running subagents belongs to another worker and isn't in this PR. This PR doesn't conflict with #23044's markup: it doesn't touch BackgroundHint or BackgroundWorkRow, and CommandRow/ToolRow only gain a branch in their meta.
Changelog
- Changed: A command an agent runs in the background shows its progress and finish on its own Ran row instead of a second row; the session start and compaction notes are one quiet line each.
Observed / Not run
Ran locally (webviews, bun 1.4.2):
bun test test/agent-pane-background-on-call.test.ts src/agent-session/acpmux/conversation/SessionStartNote.test.tsx src/agent-session/acpmux/conversation/BackgroundMark.test.tsx: 16 pass on this head. 13 of them fail with the base's sources (the other three, the dismiss test, the harness test and "never went to the background", pass on both).bun test test/agent-pane-short-command.test.ts test/pane-english.test.ts test/summary-content.test.ts test/agent-pane-session-start.test.ts test/sources-files-once.test.tsx test/agent-pane-compaction-rows.test.ts test/agent-pane-history-rowless-page.test.tsand 11 transcript and tool-row test files: all pass.bun run check: formatting, layers, type scale and protocol checks pass. The one lint warning (HistoryPage.tsxprefer-tag-over-role) comes from a file this PR doesn't touch.scripts/cmux-next/prepush-gate.py: no new violations.
Not run here: the browser-lane tests (agent-pane-background-tasks.test.ts was updated to the new behavior, plus agent-pane-step-rows and agent-pane-working-counts). They run only in CI. Gallery variants were added (agent-pane.background-task-note on-call / lone / ended, agent-pane.session-start-note details / explained) but not captured locally. No app build.
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Background shells now show their progress and finish on the "Ran" row of the call that started them instead of a second "Background task finished" row, and the session start and compaction notices are each one quiet line.
- The call's row shows a running mark, then a check with the shell's whole run time, "Failed", or "Stopped" when it ends, in whichever turn it ended.
- The "⌃B to run in background" hint shows only while the call runs in the foreground; a shell already in the background shows its
BackgroundMarkinstead. - A shell whose call is not loaded stays one note, its command cut to its working step with the full command on hover; it joins the call's row once an older page brings it.
- The session start reads "Claude Code · Opus 5.5 · sr2" (full facts on hover and click); the compaction note is one line with Learn more and a dismiss.
- The summary reads background ends from call rows too, so a finished shell isn't listed as still running.
- Adds a release note with the agents docs link, and the browser-lane fixture now reports the watcher running in the background.