fix(codex): keep delegated child-agent output out of parent chats - #5955
fix(codex): keep delegated child-agent output out of parent chats#5955Umais-Adeed wants to merge 6 commits into
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:
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 |
ApprovabilityVerdict: Needs human review This PR introduces substantial new logic (~950 additions) for multi-agent notification routing, child agent registration, and spawn ordering - beyond a simple fix. The author is new to this codebase and the changes affect core runtime behavior in the multi-agent system. 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.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 75b2a2d. Configure here.

What Changed
collabAgentToolCall.receiverThreadIdsas soon as direct child agents are spawned.Why
Codex direct child threads can emit events before T3 has registered their IDs. Those events were treated as parent-thread content, flooding the coordinator conversation and leaving the Agents panel empty or displaying opaque UUIDs.
This change keeps the coordinator timeline focused while preserving child progress in the Agents panel.
UI Changes
Before: child agents are missing from the Agents panel.
After: named child agents appear with status and usage.
Verification
Names are associated with child IDs in spawn order because the direct Codex wire shape does not provide an explicit receiver-ID-to-nickname mapping.
Checklist
Fixes #5953
Generated with GPT-5.6 Luna in T3 Code using the Codex harness.
Note
Medium Risk
Large changes to Codex notification interception and parent/child timeline routing; mistakes could hide coordinator content or leak child chatter, though coverage is extensive.
Overview
Codex direct collab child threads can emit events before T3 registers them, which previously flooded the coordinator chat and left the Agents panel empty or showing raw UUIDs. This PR tightens child registration, routing, and naming so parent and child surfaces stay separate.
Runtime (
CodexSessionRuntime) registers children fromcollabAgentToolCallreceiverThreadIds(including builds that skipthread/started/subAgentActivity), tracks spawn order (spawnIndex), and provisionally registers unknown foreign thread IDs while dropping expanded child chatter (deltas, terminal interaction, MCP progress). Child traffic is re-emitted as syntheticcollabAgent/*events; coordinator summaries are parsed viareadCoordinatorAgentNamesto emitcollabAgent/renamedin spawn order.turn/startedno longer updates session state until the root provider thread id exists.Adapter maps
collabAgent/renamedtotask.updatedwith optional title andtimelineBypass.Agents panel adds friendlier labels for opaque IDs, readable activity/role text, and copy tweaks.
Integration and wire tests cover direct spawns, naming order, unscoped children, and logical-root coordinator items.
Reviewed by Cursor Bugbot for commit c0e073d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Filter delegated child-agent output from parent chat timelines in Codex collab runtime
makeCodexSessionRuntimein CodexSessionRuntime.ts to register child agents fromcollabAgentToolCallreceiver IDs, track spawn order viaspawnIndex, and suppress child chatter (includingitem/commandExecution/terminalInteractionanditem/mcpToolCall/progress) from the parent timeline.readCoordinatorAgentNamesto parse coordinator summaries for agent names andreadCollabPromptNicknameto derive nicknames from spawn prompts; emitscollabAgent/renamedevents when names are resolved.collabAgent/renamedin CodexAdapter.ts by mapping it to atask.updatedcanonical event withtimelineBypass: true.turn/startednotifications no longer claim the root session whenproviderThreadIdis unset or mismatched; logical-root items remain on the parent timeline.Macroscope summarized c0e073d.