You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(chat): count only agents as workers; keep shell commands out of the workers tray - #50464
The "Workers" pill above the message box counted plain shell commands as workers. Now it counts only agents. Commands the agent is waiting on stay in the chat, and commands running in the background get their own "Background commands" group with their own count and Stop.
Files
Added
Deleted
Net
Test
8
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1362
$\color{#cf222e}{\Huge{\mathbf{−}}}$18
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1344
Prod
31
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1178
$\color{#cf222e}{\Huge{\mathbf{−}}}$196
$\color{#1a7f37}{\Huge{\mathbf{+}}}$982
What Changed
Before: a single Bash call the agent was waiting on showed up in the floating tray as a worker row with a spinner, and the pill said "1 worker". Background commands, monitors and workflows were all counted as workers.
After:
Commands the agent waits on never reach the tray, for any provider. They stay in their transcript tool row. A command shows up once it moves to the background (timeout, Ctrl+B, steer), read from Claude's task update or its background-task list.
"Workers" counts orchestration workers and subagents only. Background commands, monitors, workflows and unclassified tasks are listed below them under "Background commands", keep their Stop (including from a remote chat), and are never counted as workers.
Pill: "2 workers", "1 background command" (terminal icon), or "2 workers · 1 command"; the spoken name always names both in full.
Open card: agents first, then the labelled command group; each group is its own named group for screen readers; arrow keys move straight from the last worker to the first command.
Command rows are one mono line; the full command is in the tooltip and the details dialog.
Stop all moves to the card's footer and says what it stops. It never stops orchestration workers and names no target, so beside them it reads "Stop subagents and commands", with "Workers keep running" as its description; with no workers listed it stays "Stop all". When the footer is too narrow for both labels, the bulk Clear steps aside (each failed row keeps its own Clear) and the Stop label is never cut. A footer action that disappears while focused hands focus to the pill.
Lost end events stay visible. If a command the agent was waiting on is still reported running after its tool call returned and the turn ended (or after its subagent ended), it shows under Background commands with an unknown state and a Stop instead of staying hidden.
A failed foreground command is no longer kept as a failed tray row (its transcript row shows the failure), and a command, monitor or workflow row's details say "Command output is not available yet" rather than "Worker result unavailable" while output is pending.
Why
A shell command is not an agent, and counting it as one made the pill misleading. Checked against how comparable products handle this: commands the agent waits on stay inline in the conversation, background shells are a separately named list with their own Stop, and only agents count as agents.
Root cause had two parts: the shared child-work projection only hid Codex foreground commands, so every Claude Bash call (which Claude reports as a task) reached the tray; and the tray counted every row of any kind as a worker. Keeping background commands in the same card (rather than dropping them or adding a second pill) keeps their Stop reachable from remote chats without a second floating control.
Linked Issue
Internal report; no public issue.
Visual Proof
Fixture renders with made-up data (left: before, right: after).
Open card with workers and background commands:
Folded pill, workers and commands:
Folded pill, background commands only:
Testing
I manually tested these changes locally (component fixtures in headless Chromium, light and dark, 320 / 420 px; keyboard across groups)
Automated tests added/updated
Every added test fails without this change and avoids the test anti-patterns, except the guards listed below
Tests that fail without this change: the projection test (foreground commands hidden for every provider), the Claude decoder tests for background-roster promotion, survivors after the turn/subagent ends, the returned-call mark, journal-attributed owners and self-ownership, the failed-foreground retention test, and the tray tests for counts, chip/header/region names, grouping, held order, Stop all label, footer focus, Clear label, spoken-title cap, focus across group changes and held-gesture names.
Guards that also pass on main (kept on purpose): the captured Claude frame sequences (short foreground command; timeout auto-background), the basic foreground/background residency tests, and tray cases for agents only, no rows, a single group, and a command row's Stop routing.
Focus and held-name tests, with the tray component files reverted to the previous version of this branch, then with this change:
× keeps focus on the same row when a second group appears or leaves
× keeps focus on a command row when the first worker arrives
× keeps focus on a command row’s Stop when the last worker leaves
× keeps naming a held commands-only card by its rows while the live roster empties
× keeps a held folded commands-only chip’s terminal mark and name
× keeps a held mixed chip’s full spoken count
Tests 6 failed | 2 passed (guards)
✓ all 8 (same file, this change)
tests/tools/worker-dock-rendered is run by hand against the fixture server; it is not part of CI. This change moves its Stop all check to the footer and adds grouped-tray checks (both groups and their names, ArrowDown from the last worker to the first command, the commands-only chip, the footer at 320/420 px, and a 35-row virtualized mixed card crossing the groups by keyboard). Result on this branch:
83 passed, 1 failed
FAIL a detail read held across a roster change is not asked again, and a fresh one follows a stale reply (fails the same on main without this change)
(An earlier run under heavy machine load also timed out once on "sits at the start just above the queue (320px, light)"; it passes when re-run alone and in the latest full run.)
Typecheck (web, node) and lint pass.
Performance
None worth measuring. The tray does one extra pass over its listed rows per render to split them into two groups (bounded by the visible roster, already virtualized past 30 rows), and the Claude decoder does one pass over its live tasks on each tool result and turn end (a handful of entries). No new IPC, polling, subprocesses or disk access.
Risk
Level: Medium
The riskiest part is the Claude task decoder: if Claude ever reported a background move only in a way the decoder misses, that command would stay hidden until it ends. The roster and the task update both promote it, and a command still running after its call returned is surfaced rather than hidden. An older paired host still sends its foreground Claude commands; a new client shows them under Background commands, never as workers. Back out with a plain revert.
…he workers tray
The floating workers tray listed a running foreground shell command as a worker and the chip said
"1 worker". Now:
- Foreground commands (any provider's ordinary tool calls) never reach the tray; they stay in the
transcript. A command moved to the background (timeout, Ctrl+B, steer) shows up once it moves,
read from Claude's task patch or its background roster.
- "Workers" counts orchestration workers and subagents only. Background commands, monitors,
workflows and unclassified tasks are listed in their own "Background commands" group, keep their
Stop (including from a remote chat) and are never counted as workers.
- Stop all moves to the card's footer and names what it stops; it never stops orchestration
workers and never understates the provider stop.
- A foreground command still live after the call that waited on it returned is shown as background
work with an unverified state and a Stop, instead of staying hidden.
- A failed foreground command is not kept as a tray failure; monitor and workflow rows open their
run details.
No actionable comments were generated in the recent review.
Walkthrough
Claude child-work decoding now tracks foreground commands that continue after a turn and marks them unverifiable until usable progress arrives. Child-work views exclude foreground commands across providers. The worker dock groups and counts background commands separately from workers, adds scoped stop and clear controls, and updates accessible labels and translations. Tests and rendered checks cover command residency, grouping, focus behavior, and footer layouts.
Merge Risk: Minimal · up to a59ca
The tray now separates workers from background commands and keeps keyboard focus in the chat when footer actions disappear. No unresolved defects remain, so the change is ready to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: only agents count as workers, and shell commands are kept out of the workers tray. It also has the fix(chat) prefix. The title is concise and specific, and it matches …
Description check
The description follows the repository template. It covers ELI5, What Changed, Why, Visual Proof, Testing, Performance, Risk, and the checklist. The Risk level is set to Medium with a rollback method.…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: only agents count as workers, and shell commands are kept out of the workers tray. It also has the fix(chat) prefix. The title is concise and specific, and it matches the changeset, which splits background commands into their own group and keeps foreground commands out of the tray.
Full details: Description check
Explanation
The description follows the repository template. It covers ELI5, What Changed, Why, Visual Proof, Testing, Performance, Risk, and the checklist. The Risk level is set to Medium with a rollback method. The Linked Issue section says 'Internal report; no public issue,' which does not meet the template's rule for an issue link, but the author is likely an internal maintainer, so the special case may apply. The AI Disclosure and Agent skill upstream sections are left unfilled. Those sections are optional or conditional in the template, so the description is mostly complete.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
- Beside orchestration workers, Stop all always reads "Stop subagents and commands": the stop names
no target, so it can end work that starts before the tray updates.
- A footer action that leaves while focused hands focus to the pill.
- The rendered keyboard check waits for the exact destination row.
Files skipped from review as they are similar to previous changes: 11
src/renderer/src/i18n/locales/de.json
src/renderer/src/i18n/locales/en.json
src/renderer/src/i18n/locales/es.json
src/renderer/src/i18n/locales/fr.json
src/renderer/src/i18n/locales/ja.json
src/renderer/src/i18n/locales/ko.json
src/renderer/src/i18n/locales/pt.json
src/renderer/src/i18n/locales/ru.json
src/renderer/src/i18n/locales/tr.json
src/renderer/src/i18n/locales/zh-Hant.json
src/renderer/src/i18n/locales/zh.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
The "Workers" pill above the message box counted plain shell commands as workers. Now it counts only agents. Commands the agent is waiting on stay in the chat, and commands running in the background get their own "Background commands" group with their own count and Stop.
What Changed
Before: a single Bash call the agent was waiting on showed up in the floating tray as a worker row with a spinner, and the pill said "1 worker". Background commands, monitors and workflows were all counted as workers.
After:
Why
A shell command is not an agent, and counting it as one made the pill misleading. Checked against how comparable products handle this: commands the agent waits on stay inline in the conversation, background shells are a separately named list with their own Stop, and only agents count as agents.
Root cause had two parts: the shared child-work projection only hid Codex foreground commands, so every Claude Bash call (which Claude reports as a task) reached the tray; and the tray counted every row of any kind as a worker. Keeping background commands in the same card (rather than dropping them or adding a second pill) keeps their Stop reachable from remote chats without a second floating control.
Linked Issue
Internal report; no public issue.
Visual Proof
Fixture renders with made-up data (left: before, right: after).
Open card with workers and background commands:
Folded pill, workers and commands:
Folded pill, background commands only:
Testing
Tests that fail without this change: the projection test (foreground commands hidden for every provider), the Claude decoder tests for background-roster promotion, survivors after the turn/subagent ends, the returned-call mark, journal-attributed owners and self-ownership, the failed-foreground retention test, and the tray tests for counts, chip/header/region names, grouping, held order, Stop all label, footer focus, Clear label, spoken-title cap, focus across group changes and held-gesture names.
Guards that also pass on main (kept on purpose): the captured Claude frame sequences (short foreground command; timeout auto-background), the basic foreground/background residency tests, and tray cases for agents only, no rows, a single group, and a command row's Stop routing.
Focus and held-name tests, with the tray component files reverted to the previous version of this branch, then with this change:
tests/tools/worker-dock-renderedis run by hand against the fixture server; it is not part of CI. This change moves its Stop all check to the footer and adds grouped-tray checks (both groups and their names, ArrowDown from the last worker to the first command, the commands-only chip, the footer at 320/420 px, and a 35-row virtualized mixed card crossing the groups by keyboard). Result on this branch:(An earlier run under heavy machine load also timed out once on "sits at the start just above the queue (320px, light)"; it passes when re-run alone and in the latest full run.)
Typecheck (web, node) and lint pass.
Performance
None worth measuring. The tray does one extra pass over its listed rows per render to split them into two groups (bounded by the visible roster, already virtualized past 30 rows), and the Claude decoder does one pass over its live tasks on each tool result and turn end (a handful of entries). No new IPC, polling, subprocesses or disk access.
Risk
Level: Medium
The riskiest part is the Claude task decoder: if Claude ever reported a background move only in a way the decoder misses, that command would stay hidden until it ends. The roster and the task update both promote it, and a command still running after its call returned is surfaced rather than hidden. An older paired host still sends its foreground Claude commands; a new client shows them under Background commands, never as workers. Back out with a plain revert.
Review