feat(web): add the Agents panel (4/5) - #4663
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
c3a50f8 to
8c6a796
Compare
5187d5b to
cde2598
Compare
8c6a796 to
103b937
Compare
cde2598 to
fc5b293
Compare
103b937 to
31adb36
Compare
fc5b293 to
85fe8a2
Compare
31adb36 to
b270c47
Compare
85fe8a2 to
795eb20
Compare
b270c47 to
daf1a88
Compare
795eb20 to
64bf642
Compare
1dce464 to
4c169ed
Compare
32cbb3d to
c63297e
Compare
70d5111 to
c78d0ff
Compare
c63297e to
4c70ab1
Compare
Surfaces the subagent data the previous PRs record. A new right-panel tab lists every subagent on the thread with its role, model, status, token usage, recent activity, and the runs it has been activated for. Grouping lives in client-runtime rather than the component so it stays testable: workflow coordinators own their phases, phase status derives from its members, and members orphaned by a missing coordinator fall back to the flat list rather than disappearing. A coordinator is an agent in its own right, so it renders as a card rather than a bare heading — it has a model, usage and activations, and before its members are spawned it is the only row on the thread. It is counted in the tallies for the same reason, but only while it has no members, since afterwards they represent the same work and counting both double-reports it. Without that, a thread running a workflow showed "0 active" with nothing listed and unexplained tokens in the header. Usage follows the same rule: the total keeps whatever the members did not account for. Dropping the coordinator outright erased the whole workflow whenever a provider reported workflow usage but omitted per-agent tokens, and the header read "Usage unavailable" for a workflow that had spent thousands. Read-only: this only renders what the projection already contains.
Co-Authored-By: Claude <noreply@anthropic.com>
c78d0ff to
a997806
Compare
4c70ab1 to
d453837
Compare
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (Agents panel) with substantial new UI logic and state derivation code. New features with new components and non-trivial business logic warrant human review. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b1bc757. Configure here.
| totalTokens: | ||
| reportedUsage.length === 0 | ||
| ? null | ||
| : reportedUsage.reduce((total, tokens) => total + tokens, 0), |
There was a problem hiding this comment.
Token total exceeds workflow usage
Medium Severity
When per-member usage.totalTokens sum to more than the workflow coordinator’s inclusive total, reportedUsage drops the coordinator contribution entirely but still adds each member’s full usage, so the Agents header can over-report tokens relative to the workflow aggregate the derivation assumes is authoritative.
Reviewed by Cursor Bugbot for commit b1bc757. Configure here.


Fourth of five stacked PRs replacing #4551. Stacked on #4662 — review that first.
Surfaces the subagent data the previous PRs record. A new right-panel tab lists every subagent on the thread with its role, model, status, token usage, recent activity, and the runs it has been activated for. Read-only — it renders what the projection already contains.
Grouping lives in
client-runtimerather than the component so it stays testable: workflow coordinators own their phases, phase status derives from its members, and members orphaned by a missing coordinator fall back to the flat list rather than disappearing.Coordinators are agents too
A workflow coordinator has its own model, usage and activations, and before its members are spawned it is the only row on the thread. So it renders as a card rather than a bare heading, and it is counted in the tallies — but only while it has no members, since afterwards they represent the same work and counting both double-reports it.
Without that, a thread running a workflow showed
0 active · 0 waiting · 0 settledwith nothing listed, and unexplained tokens in the header.Token accounting
Same rule: the total keeps whatever the members did not account for. Dropping the coordinator outright erased the entire workflow whenever a provider reported workflow usage while omitting per-agent
tokens— the header then read "Usage unavailable" for a workflow that had spent thousands. Both fields are populated independently in the Claude adapter, so this is reachable, not theoretical.Testing
Typecheck and lint clean. Web 1,500 passing, client-runtime 486 passing.
Verified in a browser against a real Codex subagent run: the tab renders the agent with its role and model badges,
idlestatus, a real token count and run count, and an expandable "Activity and runs" section.Reviewed by an independent agent pass; the token-collapse bug and the missing coordinator card both came out of it and are fixed here.
Note
The workflow path itself (phases, coordinators) is Claude-only — no other adapter emits
kind: "workflow"— so that branch has unit coverage but has not been exercised against a live provider.Note
Low Risk
Read-only UI over existing projection data with no auth or persistence changes; layout tweaks are localized to the right panel.
Overview
Adds a read-only Agents right-panel surface that lists orchestration V2 subagents from the thread projection—roles, models, status, token usage, runs, and recent activity.
deriveOrchestrationV2SubagentPanelStatein client-runtime groups agents by workflow and phase, indexes activations, and aggregates tokens without double-counting coordinators when members report usage. Coordinators without members still count as active and render as cards (not bare headings); settled agents prefer result over stale progress.ChatViewlazy-loadsAgentsPanelV2, opens theagentssingleton via the tab bar+menu, and passesserverProjection. Right panel chrome moves maximize into the tab barlayoutControlsinstead of the main title bar when the panel is open.Reviewed by Cursor Bugbot for commit b1bc757. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Agents panel to the right panel UI for orchestration V2 subagents
AgentsPanelV2component that groups subagents by workflow/phase, shows a coordinator card, per-memberAgentCardcomponents with collapsible activity/activations, and a header with total token usage and active/waiting/settled counts.deriveOrchestrationV2SubagentPanelStateto derive structured panel state from raw subagent data, including phase ordering, activation indexing, and token aggregation that avoids double-counting workflow coordinators.'agents'as a new singleton surface kind inrightPanelStore.tsand wires it intoChatViewandRightPanelTabsso users can open the panel from the+menu or empty state.Macroscope summarized b1bc757.