Uh oh!
There was an error while loading. Please reload this page.
feat(grok): show Grok subagents in the Agents panel - #8412
feat(grok): show Grok subagents in the Agents panel#8412charindithjaindu wants to merge 2 commits into
Conversation
Claude Task and Codex collab children already emit task.* events that the right-hand Agents panel folds into a live roster. Grok Build streams the same work over x.ai session notifications, but T3 dropped them, so Grok threads never listed child agents. Map subagent_spawned/progress/finished and workflow_updated onto the existing task.started/progress/completed path, with Claude/Codex linkage (parentAgentId + timelineBypass for workflow members; standalone agent() rows stay direct subagents). Made with Grok 4.6.
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:
Comment |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2c8a9e0. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a substantial production capability for surfacing Grok subagents and workflows, including new event mapping, startup buffering, and turn-liveness behavior. The resulting changes affect existing Grok request paths and shared Agents-panel state, so the scope merits human review. You can add or adjust custom eligibility rules. Learn more. |
Subagent and workflow ACP ticks now stamp lastTurnActivityAtNanos before waking the watchdog, so a quiet parent stream is not cancelled while children are still working. Spawn-time token counts are kept in usageByTaskId so a later tools-or-duration tick cannot publish totalTokens 0. Workflow member fingerprints include the wire state so start-to-running still emits progress. Made with Grok 4.6.
charindithjaindu
commented
Aug 27, 2026
Addressed the Macroscope and Bugbot findings in 468a4bf:
Mapper + adapter tests: 49 passed. |

Problem
Claude Task and Codex collab children already emit
task.*events that the right-hand Agents panel folds into a live roster. Grok Build streams the same child work over ACP (subagent_spawned/subagent_progress/subagent_finished, plusworkflow_updated), but T3 dropped those notifications. Grok threads showed an empty Agents panel.Fix
Map Grok's x.ai session notifications onto the existing
task.started/task.progress/task.completedpath. Complexity stays at the adapter.agent()children becometaskType: "subagent"rows withtimelineBypass, so they list in the Agents panel like Claude Task.parentAgentId+timelineBypass+ a stable:wf:slot. The parent ACP session id is not used asparentAgentId(that would mis-classify a direct spawn as a workflow member).task.startedthentask.completed. Unchanged member ticks are fingerprinted and skipped. Child tokens stay ontypedUsage.client-runtime.Tests
vp test run apps/server/src/provider/acp/GrokAcpSubagents.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts— 48 passed.Made with Grok 4.6.
Note
Medium Risk
Non-trivial Grok adapter changes (notification buffering, semaphore ordering, and turn-liveness interaction) could drop or mis-time events at session startup, though scope stays within existing task.* ingestion with no contract or auth changes.
Overview
Grok Build child work (
subagent_*andworkflow_updated) was invisible in the Agents panel because those private ACP notifications were never translated into the sharedtask.*runtime events Claude Task and Codex collab already use.This PR adds
GrokAcpSubagentsto parse flexible x.ai envelopes and emittask.started/task.progress/task.completedwith the same linkage rules as other drivers: standaloneagent()rows assubagentwithtimelineBypass(no fakeparentAgentId), workflow members under alocal_workflowparent with stablerunId:wf:agentIdslots.GrokAdapterregisters four notification methods, queues early notifications until the session context exists, then flushes them under a lock and refreshes turn liveness when subagent ticks arrive so long quiet parent streams do not stall the watchdog.The ACP mock agent can emit a sample subagent lifecycle when
T3_ACP_EMIT_XAI_SUBAGENT=1; unit and adapter tests cover parsing, dedupe, and end-to-end streaming.Reviewed by Cursor Bugbot for commit 468a4bf. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Show Grok subagents in the Agents panel by mapping session notifications to
task.*events_x.ai/session/updatenotifications and parses them as workflow or subagent updates via GrokAcpSubagents.ts, emitting canonicaltask.started/task.progress/task.completedevents with stableRuntimeTaskIdsT3_ACP_EMIT_XAI_SUBAGENTin acp-mock-agent.ts to simulate subagent lifecycle notifications for testingpending+ readiness flag inGrokSessionContext; if the session-start handshake does not flip the readiness flag, buffered workflow/subagent events may be dropped silentlyMacroscope summarized 468a4bf.