Skip to content

Session Info: the Subagents head and its running limit count the same running set - #33177

Closed
teamleaderleo wants to merge 3 commits into
feat-cmux-nextfrom
lane/subagent-running-count
Closed

teamleaderleo wants to merge 3 commits into
feat-cmux-nextfrom
lane/subagent-running-count

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Session Info's Subagents section could say "2 running · 13 done" in its head while the running-limit line under it said "Running 1 / 1000 max". Leo saw it in the live nightly: "yeah idk what's going on there".

Cause

The two numbers counted different things:

  • The head (subagentCounts) counted the harness's own subagents plus the chats the agent started.
  • The limit line (slotCounts in subsessionLimits.ts) counted only the started chats. It also counted a chat by its raw state, so a chat acpmux retries did not count as running, though the head counts it.
  • A chat acpmux holds for a free slot (waitsForSlot, state idle) showed as "1 queued" on the limit line but was counted as done in the head.

Fix

Both now read one tally, subagentTally in session-info/SubagentsSection.tsx, in the web panel (SessionInfo.tsx, SubagentLimitStepper.tsx) and in the native panel model (session-info/native/subagents.ts). Each subagent and each chat is counted by the status its line shows. "Running N" is the head's waiting plus running. A chat held for a slot counts as queued in both places, and the head now says "1 queued" too. Until the list names any chats, acpmux's own limits.running and limits.queued stand in for them in both places, as they already did for the limit line.

Trade-off: acpmux's maxRunning caps only started chats, so with harness subagents running the line can read above its max (the subagent-limit gallery variant shows "Running 5 / 2 max · 1 queued"). That matches what is actually running. A follow-up could split the line if that reads badly.

Design spec: design/session-info.md (Subagents). Overlapping open PRs (#27966, #32836, #33152, #31674) touch the same files but none changes these counts.

Changelog

Fixed: Session Info's Subagents head and its running limit now count the same running subagents and chats.

Tests

  • webviews/src/agent-session/acpmux/session-info/subagentTally.test.ts (new). The first commit adds only the native-panel case, which fails on the base: the head reads "2 running · 14 done" and the limit reads "Running 1 / 1000 max". The second commit adds the fix and two more cases; the third moves test/subagent-limit-stepper.test.tsx to the new API with the same expectations.
  • The agent-pane.chat-inspector / subagent-limit gallery variant gains a sameRunningSet play. It checks that the head's waiting plus running equals the limit line's "Running N", and that both say "1 queued".
  • Command: cmux-ci test -- bun test src/agent-session/acpmux/session-info/subagentTally.test.ts (red at 4cf7b39), then bun test src/agent-session/acpmux/session-info/ && bun run check at the head.

Observed / Not run

  • Observed: at 4cf7b39 the new test fails (run 41590044181: Expected "2 running · 1 queued · 13 done", Received "2 running · 14 done"). At 08c2063, bun test src/agent-session/acpmux/session-info/ test/subagent-limit-stepper.test.tsx gives 21 pass, 0 fail, and bun run check passes except for check:design-tokens. That check fails on the base too (cloudStart.css height 1px, from Cloud start checklist: state words no longer overlap step names; Starting Claude while it starts #33139), and this PR does not touch that file.
  • Not run: the gallery play in a browser (it runs in the gallery advisory run), and a live nightly check.

Review (subagent, correctness, Opus 5.5): SHIP at 08c2063. Follow-ups: the line can read over max (above).

🤖 Generated with Claude Code

Agent session: agent session

teamleaderleo and others added 2 commits November 2, 2026 22:27
…e set

Red on base: the head counts the subagents and the chats, the limit's line
only the chats, and a chat waiting for a slot reads as done in the head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-fb75b7af9902231028aa
…ing set

The head ("2 running · 13 done") counted the subagents and the started
chats; the limit's line ("Running 1 / 1000 max") counted only the chats,
missed a retrying one, and the head called a chat waiting for a slot done.
Both now read subagentTally: running is the head's waiting plus running,
and a chat acpmux holds for a slot is queued in both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-fb75b7af9902231028aa
@teamleaderleo teamleaderleo added the risk:low Risk tier (docs/ci/risk-tiers.md) label Nov 3, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent, correctness, Opus 5.5): SHIP at 5c740f8

Follow-ups: [follow-up] the limit line can read over its max while harness subagents run (maxRunning caps only started chats).

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 08c2063: 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=pr33177 -f ref=lane/subagent-running-count -f platform=macos -f backend_mode=local

Unclear: web / react-apps-check failed: no known signature; failed step: Check webview test shards. CI was cancelled before it finished.

CI stopped on 08c206301e (run 41592572142 attempt 1): 1 unknown.

Job Verdict Why
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Not re-run automatically: web / react-apps-check is not a machine failure.

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); base red: the same failure on the base 191abdc; does not block
red: web / Web status; a job it gathers is red on this change (its line here); do not merge until green; see lane-rules
red: web / react-apps-check; a job it gathers ended without a verdict (web / react-apps-check (8): cancelled); do not merge until green; see lane-rules

Gallery before/after for 08c2063: 16 states rendered, 13 images differ, 3139 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41592572246 -R manaflow-ai/cmux -n gallery-advisory-33177-08c206301eccebc7dcbc3ae9ce515057005bf3f4 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.chat-inspector/full Apple System Colors Light changed 0.0636% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/full Apple System Colors changed 0.0252% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/compact-more Apple System Colors Light changed 1.87% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/compact-more Apple System Colors changed 0.0099% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/compact-more-open Apple System Colors changed 0.0473% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/compact-more-open Apple System Colors Light changed 0.0102% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/compact-folded Apple System Colors Light changed 0.0808% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/compact-folded Apple System Colors changed 0.0648% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/compact-capped Apple System Colors Light changed 0.0252% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/compact-capped Apple System Colors changed 0.0099% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/workflow-running Apple System Colors Light changed 0.0063% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/workflow-running Apple System Colors changed 0.0056% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/workflow-finished Apple System Colors Light unchanged 0% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/workflow-finished Apple System Colors unchanged 0% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/workflow-agent-failed Apple System Colors Light unchanged 0% own SessionInfo.gallery.tsx
agent-pane.chat-inspector/workflow-agent-failed Apple System Colors unchanged 0% own SessionInfo.gallery.tsx
agent-pane.chat-inspector-surfaces/transcript Apple System Colors Light unchanged 0% own SessionInfo.tsx
agent-pane.chat-inspector-surfaces/transcript Apple System Colors unchanged 0% own SessionInfo.tsx
agent-pane.chat-inspector-surfaces/diff-in-place Apple System Colors Light unchanged 0% own SessionInfo.tsx
agent-pane.chat-inspector-surfaces/diff-in-place Apple System Colors unchanged 0% own SessionInfo.tsx
agent-pane.chat-inspector-surfaces/document-beside Apple System Colors Light unchanged 0% own SessionInfo.tsx
agent-pane.chat-inspector-surfaces/document-beside Apple System Colors unchanged 0% own SessionInfo.tsx
agent-pane.chat-inspector-surfaces/diff-closed Apple System Colors Light changed 0% own SessionInfo.tsx
agent-pane.chat-inspector-surfaces/diff-closed Apple System Colors unchanged 0% own SessionInfo.tsx
agent-pane.inspector-composer-foot/animated Apple System Colors Light unchanged 0% own SessionInfo.tsx
agent-pane.inspector-composer-foot/animated Apple System Colors unchanged 0% own SessionInfo.tsx
agent-pane.inspector-composer-foot/jump Apple System Colors Light unchanged 0% own SessionInfo.tsx
agent-pane.inspector-composer-foot/jump Apple System Colors unchanged 0% own SessionInfo.tsx
agent-pane.inspector-composer-foot/steady Apple System Colors Light unchanged 0% own SessionInfo.tsx
agent-pane.inspector-composer-foot/steady Apple System Colors unchanged 0% own SessionInfo.tsx
agent-pane.inspector-composer-foot/popover Apple System Colors Light unchanged 0% own SessionInfo.tsx
agent-pane.inspector-composer-foot/popover Apple System Colors unchanged 0% own SessionInfo.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions github-actions Bot added risk:normal Risk tier (docs/ci/risk-tiers.md) and removed risk:low Risk tier (docs/ci/risk-tiers.md) labels Nov 3, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Found 7 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp26xpfkbv/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmprdob2uga/summary-fail.json (live):/summary-fail.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
build_only must be a conjunctive exclusion on the helper, signing, and publication jobs
, and must not gate the unsigned app build/
build_only must be a conjunctive exclusion on the helper, signing, and publication jobs
, and must not gate the unsigned app build
View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent, correctness, Opus 5.5): SHIP at 08c2063

Follow-ups: [follow-up] the limit line can read over its max while harness subagents run (maxRunning caps only started chats).

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #33194, which landed first and fixes the same Session Info mismatch ("2 running · 13 done" over "Running 1 / 1000 max") a different way. The limit line now says it counts started chats ("Started chats: N of M at once"), so it no longer looks like the head's count. This PR made both read one tally instead, which conflicts with that design.

One smaller issue is still on base after #33194: the head counts a chat that acpmux holds for a free slot (waitsForSlot, state idle) as done, while the limit line counts it as queued. I'll raise it as a follow-up rather than carry it here.

@teamleaderleo
teamleaderleo deleted the lane/subagent-running-count branch November 3, 2026 08:31

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 08c20630 Deployed Nov 3, 2026 by teamleaderleo via cmux-tui tree preflight #104471
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