Repository navigation
Session Info: the Subagents head and its running limit count the same running set - #33177
teamleaderleo wants to merge 3 commits into
Conversation
…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
|
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). |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Unclear: CI stopped on
Not re-run automatically: Written by red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base 191abdc; does not block Gallery before/after for
States
Pick other states with a |
|
Owned by an agent session · session |
|
Found 7 test failures on Blacksmith runners: Failures
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-fb75b7af9902231028aa
|
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). |
|
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 ( |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
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:
subagentCounts) counted the harness's own subagents plus the chats the agent started.slotCountsinsubsessionLimits.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.waitsForSlot, stateidle) showed as "1 queued" on the limit line but was counted as done in the head.Fix
Both now read one tally,
subagentTallyinsession-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 ownlimits.runningandlimits.queuedstand in for them in both places, as they already did for the limit line.Trade-off: acpmux's
maxRunningcaps only started chats, so with harness subagents running the line can read above its max (thesubagent-limitgallery 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 movestest/subagent-limit-stepper.test.tsxto the new API with the same expectations.agent-pane.chat-inspector/subagent-limitgallery variant gains asameRunningSetplay. It checks that the head's waiting plus running equals the limit line's "Running N", and that both say "1 queued".cmux-ci test -- bun test src/agent-session/acpmux/session-info/subagentTally.test.ts(red at 4cf7b39), thenbun test src/agent-session/acpmux/session-info/ && bun run checkat the head.Observed / Not run
bun test src/agent-session/acpmux/session-info/ test/subagent-limit-stepper.test.tsxgives 21 pass, 0 fail, andbun run checkpasses except forcheck:design-tokens. That check fails on the base too (cloudStart.cssheight 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.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