Skip to content

Agent pane: read the agent a shell call starts (codex exec, claude -p, acpmux run) - #25040

Merged
teamleaderleo merged 8 commits into
feat-cmux-nextfrom
claude/xfamily-agent-runs
Oct 25, 2026
Merged

teamleaderleo merged 8 commits into
feat-cmux-nextfrom
claude/xfamily-agent-runs

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Leo, 2026-10-24, word for word, looking at a codex exec review that renders as a plain "Command" row:

"this is mildly interesting i think being able to do it like a cmux-next natively rendered thing of subsession/non-same-model-family subagent would be a cool depiction"

"plus supporting the situation better in acpmux"

This is the first of two PRs. It adds the part that reads which agent a shell call starts. The next PR uses it to render such a call as a Subagent: the same card and Session Info row that sub-sessions and subagents get. It's split to stay under the ~800-line limit.

What changes

webviews/src/agent-session/acpmux/subagents/agentRuns.ts (new, not wired in yet):

  • agentRun(command) returns the agent a shell command starts: its harness, model, effort, prompt, acpmux session name and host. It returns undefined when the command starts no agent.
  • It reads the command with a real shell tokenizer, not a search of the text. The tokenizer handles quotes, $'…', escapes, ;/&&/||/|, { … } and ( … ), comments, $(…)/backquotes (kept as one word), fd redirections like 2>&1, and <, <</<<- heredocs and <<< here-strings as standard input.
  • It looks through wrappers that just run the next words: VAR=x, env, nohup, exec, time, nice, caffeinate, timeout/gtimeout, sr, and perl -e 'alarm N; exec @ARGV'. It also re-parses the command strings that reach HOST '…', ssh HOST '…' and sh|bash|zsh -c '…' run. reach and ssh give the host, and the outer stdin is passed into the inner command.
  • Each agent CLI's grammar is one declarative table entry: what starts a non-interactive run (codex exec, claude -p, acpmux run|new|exec), which options take a value, and where the model, effort, session name and prompt are. That covers Codex's -m and -c model_reasoning_effort=…/-c model=…, Claude's --model/--effort, and acpmux's -m HARNESS[/MODEL], -e, -n, --host and --prompt-file. --help/--version start nothing, and neither does another subcommand (acpmux send). A bare acpmux new -n x with no prompt starts nothing either.
  • Helpers for the card: promptTitle (the first line of the prompt that says something), runModel ("gpt-6-astra xhigh"), harnessFamily/harnessLabel, runReply (Codex's final message after its tokens used log, with Claude Code's "Shell cwd was reset" trailer removed), and backgroundOutputPath.

Risk

None at runtime: nothing imports the module yet. The next PR wires it into the subagent fold.

Tests

agentRuns.test.ts uses commands Claude Code recorded on 2026-10-24, with the paths scrubbed: a Codex review through reach with its prompt on stdin, the perl alarm wrapper, a heredoc prompt, a nohup sh -c inside reach behind a pipe, and acpmux new/run, sr codex and claude -p. Negatives from the same recordings: grep "codex exec", codex exec --help, pgrep -fl 'codex exec|…', a heredoc whose text mentions codex exec, acpmux send, a bare acpmux new, claude mcp list. The webview CI jobs run the suite: huge-blue is out of memory right now, so it wasn't run locally. An independent Codex review comes before landing.

Agent session: cosmic-gray

🤖 Generated with Claude Code


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

…, acpmux run)

A shell tokenizer and each agent CLI's grammar, so the transcript can draw such a call as
that agent (the next PR). Looks through timeout, nohup, env, sr, the perl alarm wrapper,
reach/ssh/sh -c command strings and heredoc or < stdin prompts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16f9b-2fcb-7c72-b06e-af8fce00adcb&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review aaa81e2: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr25040 -f ref=claude/xfamily-agent-runs -f platform=macos -f backend_mode=local

Unclear: web / react-apps-check failed: no known signature; failed step: Check webview test shards. This PR merged before its CI finished: fix forward on main.

CI failed on aaa81e2b16 (run 40162552319 attempt 1): 4 code, 1 unknown.

Job Verdict Why
web / react-apps-base-check (1) code a web test failed
web / react-apps-base-check (2) code a web test failed
web / react-apps-base-check (3) code a web test failed
web / react-apps-base-check (4) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs claimPaint.test.tsx a pooled Settings page claimed by the host reports its paint once its first screen is in: failed (job)
  • seen on other PRs claimPaint.test.tsx a Settings page loaded fresh reports its first paint once its first screen is in: failed (job)
  • seen on other PRs accent-glass-invariants.test.ts no orange or system accent and no opaque glass on 2047 gallery stages: failed (job)
  • seen on other PRs agent-pane-agents-pill.test.ts by default the running agents sit in the tray above the composer, not in the transcript: failed (job)
  • seen on other PRs agent-pane-background-tasks.test.ts the summary card lists the chat's background tasks: running ones first, the finished folded: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts composer at 1x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts newtab at 1x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts composer at 2x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-queue-collapse.test.ts a long queue > an opened long queue keeps Show less and the focused row in sight, never a half row (...: failed (job)
  • seen on other PRs agent-pane-queue-collapse.test.ts a long queue > an opened queue with a two-line row shows whole rows only, no row under another (capt...: failed (job)
  • ... 22 more in the job logs
Matched log lines
web / react-apps-base-check (1): (fail) a pooled Settings page claimed by the host reports its paint once its first screen is in [173.10ms]
web / react-apps-base-check (2): (fail) a long queue > an opened long queue keeps Show less and the focused row in sight, never a half row (capture, 2026-10-15) [1262.56ms]
web / react-apps-base-check (3): (fail) every step is one 26px row on one rhythm, across transcript rows [1242.47ms]
web / react-apps-base-check (4): (fail) chromium > a prompt the fold hides, run elsewhere, leaves no room as the stack shrinks, opens and closes [5213.45ms]

Not re-run automatically: web / react-apps-base-check (1), web / react-apps-base-check (2), web / react-apps-base-check (3), web / react-apps-base-check (4), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 7921f4f to compare; do not merge until green; see lane-rules
red: web / Web status; NEW: green on the base 7921f4f; do not merge until green; see lane-rules
red: web / react-apps-base-check (1); no finished base run on 7921f4f to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (2); no finished base run on 7921f4f to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (3); no finished base run on 7921f4f to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (4); no finished base run on 7921f4f to compare; do not merge until green; see lane-rules
red: web / react-apps-check; no finished base run on 7921f4f to compare; do not merge until green; see lane-rules

Tour of aaa81e2b16 (run): no media. The tour did not run: only webview code changed (2 path(s)), which the gallery advisory run checks in Linux Chromium on the pull request (its artifact holds any captures); add the media-tour-mac label, then re-add media-tour, to tour it on a Mac.

Gallery before/after for aaa81e2: the capture produced no images (run).

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 25, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Found 98 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp3i7mpnaw/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmp4nw8ip_z/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
nightly.yml prepare-nightly-variant: 'Package prepared app for signing' is not in list/
nightly.yml prepare-nightly-variant: 'Package prepared app for signing' is not in list
View Logs
test/agent-pane-queue-collapse.test.ts/agent-pane-queue-collapse.test View Logs
test/agent-pane-queue-collapse.test.ts/agent-pane-queue-collapse.test View Logs

...and 88 more test failures. View all on Blacksmith: run 40162552319, run 40162552294, run 40162552276

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-5g2bx created for this PR by the cmux coordinator.

teamleaderleo and others added 7 commits October 25, 2026 02:02
command -v and a perl script that is not the alarm wrapper start nothing; attached short
options (-mgpt-6), env -S and a prompt after -- read; acpmux run --parent (#25019) makes a
sub-session acpmux records with typed state, which draws it, not its command.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16f9b-2fcb-7c72-b06e-af8fce00adcb&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
env reads its own options (-S/--split-string, -u, -C, --) and splits only one command;
command -p -v is a lookup; assignments count only before a command and after env; at most
8 wrappers; --parent only among the options. A run folds only when both harnesses are known
and differ, and a run's output file is forgotten once it ended and was read.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16f9b-2fcb-7c72-b06e-af8fce00adcb&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sh -c and perl -e count only among the leading options (a script file before them runs
instead), perl's -- ends its options, an env -S string that is not one command is not read,
and exec -a takes a name. A run ended by the turn's stop forgets its output file; a stopped
run's card says Stopped, not Failed; a call met before the chat's harness was known folds again
once it is. The gallery's fixture names no fleet host and covers only the card.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16f9b-2fcb-7c72-b06e-af8fce00adcb&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
time's -o and -f take a value, perl reads -eSCRIPT and -we SCRIPT, and a function definition
(f() { … }, function f { … }) runs nothing until it is called, so its body is not a run.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16f9b-2fcb-7c72-b06e-af8fce00adcb&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An array assignment (args=(codex exec "x")) is data, and a quoted brace closes no function
body: words keep their source.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16f9b-2fcb-7c72-b06e-af8fce00adcb&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 25, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo
teamleaderleo merged commit 603541a into feat-cmux-next Oct 25, 2026
128 of 136 checks passed
@teamleaderleo
teamleaderleo deleted the claude/xfamily-agent-runs branch October 25, 2026 05:17
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant