Skip to content

Agent pane: an agent a shell call starts (codex exec, acpmux run) draws as a subagent - #25043

Merged
teamleaderleo merged 5 commits into
feat-cmux-nextfrom
claude/xfamily-agents
Oct 25, 2026
Merged

teamleaderleo merged 5 commits into
feat-cmux-nextfrom
claude/xfamily-agents

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #25040 (agentRuns.ts). #24977 (AgentCard) has landed, and this branch is rebased onto feat-cmux-next. Until #25040 lands, the diff here also includes its two files (agentRuns.ts and its test). Its own change is about 640 lines. The typed-data follow-up for acpmux run --parent (acpmux #25019) is #25062.

Leo, 2026-10-24, word for word, looking at a codex exec review that renders as a plain "Command" row (spinner, "5m 13s Running", a stop square; Session Info → Background tasks shows only { cat /Users/…/flee… 5m 13s):

"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"

What changes

A shell call that starts an agent from another model family is now that agent, a Subagent in the existing fold. Examples: codex exec …, claude -p …, acpmux run|new|exec …, sr codex …, and any of these through reach HOST '…', ssh, sh -c, timeout, nohup, env or the perl -e 'alarm N; exec @ARGV' wrapper. "Different family" means the harness the call runs (from the executable, or from acpmux's -m) differs from this chat's harness (summary.harness). So a Codex chat's own codex exec stays a command.

  • subagentFold.ts reduceRun: the call's tool_call (with rawInput.command, a string or Codex's argv) becomes a Subagent with id run:<callId> and its own group row. The Subagent carries:

    • the harness and the model plus effort ("gpt-6-astra xhigh");
    • kind "Codex · gpt-6-astra xhigh";
    • its name: the first line of the prompt (inline, heredoc or here-string), else the call's description;
    • the command, the acpmux session name and the host.

    The call's updates become the run's own view, so opening the run shows the Command row with everything it printed. When the call completes or fails, the run is done or failed, with its reply: Codex's final message after its tokens used log, or the output's tail. A call that goes to the background ("Output is being written to …") keeps running until acpmux's background_task_update ends it. A later Read, cat or tail of that output file sets the reply. A turn's end ends a foreground run whose end never arrived, the same way it does for Claude subagents.

  • direct.ts: the chat's harness goes to the fold. If a call is only recognized as a run once its command arrives in a later update, its earlier Command row is dropped (dropToolItem).

  • AgentRunCard.tsx (new) draws the run's group row with Agent pane: sub-session calls render as live sub-session cards, not JSON #24977's AgentCard, the same card sub-sessions use. It shows the harness mark, title, model (plus the host), state (the shared working spinner, then Done/Failed) and elapsed time. Once the run ends it shows the reply as Markdown cut to three lines (the sub-session card's Cut). Raw opens the command. Show output opens the run's view. For an acpmux run whose -n session is in the session list, Open chat opens it through SubsessionContext.open.

  • The tray above the composer, Session Info's Subagents section and the Subagents tab list the run like any subagent, with the harness's mark (AgentLine mark) and "Codex · gpt-6-astra xhigh". The swallowed call no longer shows under Background tasks. A run has no Stop or Restart button, since those are Claude's own.

  • runningTray.ts/subagentRows.ts: a run group (isRunGroup) keeps its card where it started, also in the tray's layout. It never opens into a list. model.ts estimates its height.

The fallback is the command text. hb-acpmux is adding typed parent/state/result data to acpmux run/new (--parent), and was asked for the event shape. A small follow-up PR will read that data first once it merges.

Gallery

agent-pane.agent-runs. Every row is folded through the real SubagentFold from the update shapes Claude Code recorded for these calls, with scrubbed paths and synthetic prompts and replies. Variants:

  • before: today's Command row.
  • card-running (shipped): running, with the spinner.
  • card-done (shipped): done with its reply, failed, and an acpmux run with Open chat.
  • group (not picked): the run as a plain subagent group card.
  • line (not picked): a tray line plus a one-line end.
  • summary: the Session Info rows.

I picked the card because it is the only variant that shows the model and the reply where the run happened, and it is the card sub-sessions already use.

Captured on huge-blue (Linux Chromium, w420) from the gallery at this head. before is the same recorded call drawn as the base draws it.

Dark Light
Before: the call as a Command row
After: running, its card and tray line
After: done with reply, failed, acpmux with Open chat
After: Session Info's Subagents
Not picked: group, line

Risk

Contained to the agent pane's webview. It only changes how shell calls that start another family's agent render. Every other call keeps its row, and the parser returns nothing for anything it can't read. No new timers: elapsed time uses useNow, which ticks only while a run runs and stops when the pane is hidden. No observers beyond Cut's existing one per card. The per-event cost is a Map lookup. The command is tokenized once per call, and calls that start no agent are remembered so they are never parsed again.

Tests

  • agentRunFold.test.ts: a run's start, end and reply; a failed run; a background run that ends through background_task_update and gets its reply from a later Read; a turn's end that leaves a background run running; a same-family call and a grep that stay commands; a Codex chat's claude -p.
  • agentRuns.test.ts (from Agent pane: read the agent a shell call starts (codex exec, claude -p, acpmux run) #25040).
  • The webview CI jobs run them along with typecheck, lint and fmt. They couldn't run locally because huge-blue is out of memory.

Agent session: cosmic-gray

🤖 Generated with Claude Code

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by claude-sr2/subsession-card on cosmic-gray · session

@blacksmith-sh

This comment has been minimized.

@blacksmith-sh

This comment has been minimized.

@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.

Base automatically changed from claude/subsession-card to feat-cmux-next October 25, 2026 03:10
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 25, 2026
teamleaderleo and others added 2 commits October 24, 2026 20:12
codex exec, claude -p, acpmux run (agentRuns.ts) in a chat of another family fold to a
Subagent: its card where it started (AgentRunCard on AgentCard), its tray line and its
Session Info row, with its harness mark, model and effort, live state, time and reply.
A background run ends with acpmux background_task_update; a later read of its output file
is its reply.

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>
@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 661c37e: 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=pr25043 -f ref=claude/xfamily-agents -f platform=macos -f backend_mode=local

Probably yours: agent-pane-step-rows.test.ts fails here but not on main's latest full suite. Seen on other PRs too (likely flaky): composer-bottom-space.test.ts, composer-location-strip.test.ts, composer-location-strip.test.ts and 28 more. This PR merged before its CI finished: fix forward on main.

CI failed on 661c37eaf9 (run 40162554826 attempt 1): 4 code, 1 unknown.

Job Verdict Why
web / react-apps-base-check (4) code a web test failed
web / react-apps-base-check (3) code a web test failed
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-check unknown no known signature; failed step: Check webview test shards

Failures:

  • new in this PR agent-pane-step-rows.test.ts every step is one 26px row on one rhythm, across transcript rows: failed (job)
  • seen on other PRs composer-bottom-space.test.ts (unnamed): failed (job)
  • seen on other PRs composer-location-strip.test.ts the chat composer at 420 px: the strip heads the card, one controls row inside: failed (job)
  • seen on other PRs composer-location-strip.test.ts the chat composer at 720 px: the strip heads the card, one controls row inside: failed (job)
  • seen on other PRs composer-location-strip.test.ts a new chat's composer at 420 px: the strip heads the card, one controls row inside: failed (job)
  • seen on other PRs composer-menu-width.test.ts composer menus in chromium > the portaled location menu gets the pane's menu surface, not a clear ba...: failed (job)
  • seen on other PRs composer-menu-width.test.ts composer menus in webkit > the portaled location menu gets the pane's menu surface, not a clear back...: failed (job)
  • seen on other PRs composer-paste-text.test.tsx Paste as Plain Text of only a file leaves no raw paste armed for the next text paste: 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 (4): (fail) every step is one 26px row on one rhythm, across transcript rows [1218.99ms]
web / react-apps-base-check (3): (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) [1225.94ms]
web / react-apps-base-check (1): (fail) chromium > a prompt the fold hides, run elsewhere, leaves no room as the stack shrinks, opens and closes [5229.93ms]
web / react-apps-base-check (2): (fail) a pooled Settings page claimed by the host reports its paint once its first screen is in [178.33ms]

Not re-run automatically: web / react-apps-base-check (4), web / react-apps-base-check (3), web / react-apps-base-check (1), web / react-apps-base-check (2), 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 9e8ad58 to compare; do not merge until green; see lane-rules
red: web / Web status; no finished base run on 9e8ad58 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (1); no finished base run on 9e8ad58 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (2); no finished base run on 9e8ad58 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (3); no finished base run on 9e8ad58 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (4); no finished base run on 9e8ad58 to compare; do not merge until green; see lane-rules
red: web / react-apps-check; no finished base run on 9e8ad58 to compare; do not merge until green; see lane-rules

Tour of 661c37eaf9 (run): no media. The tour did not run: only webview code changed (16 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 661c37e: the capture produced no images (run).

@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/tmpn_cuektr/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpusmoxd52/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 40162554826, run 40162554636, run 40162554681

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

teamleaderleo and others added 3 commits October 24, 2026 20:45
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>
@teamleaderleo
teamleaderleo merged commit 9d4eb30 into feat-cmux-next Oct 25, 2026
126 of 136 checks passed
@teamleaderleo
teamleaderleo deleted the claude/xfamily-agents branch October 25, 2026 05:18
@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