Add subagent activity visibility#3176
Conversation
- Track subagent parent activity by child thread plus parent item id - Restart resumed child relations and append new prompt blocks - Update sidebar and work-log dedupe to keep resume blocks distinct
- Treat follow-up completions as terminal subagent snapshots - Keep prior subagent status visible when a new parent item restarts the same thread - Update ingestion tests and timeline rendering to track parent item IDs
- Track subagent child dedupe keys by parent turn when available - Keep resumed child blocks working in the timeline instead of completed - Add regression coverage for duplicate resumed subagent entries
…ading-work # Conflicts: # apps/web/src/components/ChatView.tsx # apps/web/src/components/Sidebar.tsx # apps/web/src/components/chat/ChatHeader.tsx # apps/web/src/components/chat/MessagesTimeline.tsx # apps/web/src/environments/runtime/service.ts # apps/web/src/hooks/useThreadActions.ts # apps/web/src/store.test.ts # apps/web/src/store.ts # apps/web/src/types.ts
|
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 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 |
ApprovabilityVerdict: Needs human review Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
- Mark child shells stopped when no turn can be interrupted - Generate titles for parent-linked early child shells
- Read root-level parentCollab metadata during ingestion - Keep subagent docs and sidebar filtering aligned
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 20c2897. Configure here.
- Keep terminal sidebar threads visible when a descendant is active - Match resumed subagent timeline status by parent item first
- Match by parent turn when child item ids are incomplete - Cover missing child parent item ids in timeline rendering
- Require turn matches for reused subagent parent item ids - Reuse sidebar thread maps and make root callers explicit - Add regression coverage for subagent ordering and matching
- Keep matching parent item ids when work-log turn ids are missing - Add regression coverage for item-id-only subagent rows
- Document sidebar structural traversal fixes - Capture parent item and turn matching semantics

Summary
This branch turns Codex subagent work into first-class, routeable child threads instead of mixing every child output item into the parent timeline. Parent conversations now show compact subagent activity blocks, while each child thread owns its prompt, output, tool activity, file changes, and nested child summaries.
The implementation is Codex-scoped. Providers without durable child-thread lineage continue using the previous fallback behavior.
Fixes #538.
What Changed
SUBAGENTS.mdto document the implemented behavior, provider scope, decisions, verification, and remaining hardening areas.Why
Subagent output currently becomes very jumbled and impossible to follow when child work, tool calls, diffs, and parent activity all render in the same parent conversation stream. This change gives subagent activity proper visibility: the parent remains readable, active child work is discoverable, and detailed child output is still reachable in its own thread.
Validation
pnpm exec vp checkpassed. It reported 20 existing lint warnings in unrelated mobile/markdown/command-palette files and 0 errors.pnpm exec vp run typecheckpassed across all 15 packages.pnpm --filter t3 exec vp test run src/provider/Layers/CodexAdapter.test.ts src/orchestration/Layers/ProviderCommandReactor.test.ts src/orchestration/Layers/ProviderRuntimeIngestion.test.ts --reporter=dotpassed: 3 files, 103 tests.pnpm --filter @t3tools/web exec vp test run src/session-logic.test.ts --reporter=dotpassed: 1 file, 66 tests.pnpm --filter @t3tools/web exec vp test run src/components/Sidebar.logic.test.ts src/components/chat/MessagesTimeline.test.tsx --reporter=dotpassed: 2 files, 71 tests.pnpm exec vp test apps/web/src/components/Sidebar.logic.test.ts apps/web/src/components/chat/MessagesTimeline.test.tsxpassed after the final review fixes.coderabbit review --agent --base-commit f744946f16b1858f2bd52b702949f97a9ab31a69 -c AGENTS.mdpassed with 0 findings after a rate-limit retry.codex exec --sandbox read-only --json --output-last-message /dev/fd/3 review --base f744946f16b1858f2bd52b702949f97a9ab31a69found two edge cases that were fixed inf282a2bf.$blast-reviewfound additional parent-collab/sidebar/doc hardening that was fixed in20c2897f.20c2897ffound three sidebar/status edge cases that were fixed in8516959,2ef7d4d,92b6596, and498a130.8516959found 0 issues.8516959found one legacy fallback issue that was fixed in2ef7d4d.$blast-reviewon2ef7d4dfound additional matching/readability/test/performance hardening that was fixed in92b6596.92b6596found 0 issues.92b6596found one item-id-only compatibility issue that was fixed in498a130.Proof
subagents.mp4
Note
High Risk
Large cross-cutting change to orchestration, persistence migrations, provider ingestion, and thread lifecycle; incorrect subagent routing or cascade delete/archive could affect live sessions and data integrity.
Overview
Codex subagent work is modeled as first-class child threads with persisted
parentRelationmetadata, instead of mixing child output into the parent timeline.Server / data: Projection threads gain parent/root lineage columns (migrations 33–34), snapshot queries expose
parentRelation, and upserts preserve existing subagent rows. Codex runtime maps collab child sessions to deterministic local thread ids, attachessubagentChildren/parentCollabon events, buffers child deltas until the parent collab item completes, and ingestion creates or updates child shells, appends raw launch prompts viathread.message.user.append, generates child titles, and tracks terminal status. Subagent interrupts go through the provider-bound root session; archive/delete cascades to descendants.Web: The sidebar nests running subagents under parents, hides terminal children unless on the active path, and parent timelines show compact subagent blocks (not child tool/diff noise). Child views use a SubagentControlBar (stop + parent navigation) instead of the composer.
Scope is Codex-only; other providers keep prior inline behavior.
SUBAGENTS.mddocuments the implemented plan and remaining hardening items.Reviewed by Cursor Bugbot for commit 62c9a54. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add subagent thread visibility with hierarchical sidebar display and cascading lifecycle operations
OrchestrationThreadParentRelationto the contracts layer, adding parent/child relationship metadata to thread models, commands, and event payloads across the stack.ProviderRuntimeIngestionnow creates and tracks subagent child threads from provider collab events, generating deterministic child thread IDs and maintainingparentRelationstate through the projection pipeline.thread.deleteandthread.archivecommands now cascade to subagent descendants in depth-first order;project.deletewith force targets lifecycle root threads first.SubagentControlBarfor active subagent threads showing live status, elapsed duration, and a Stop button; the messages timeline shows per-child subagent rows with navigation to child threads.parent_kind,root_thread_id, and related subagent columns onprojection_threads.Macroscope summarized 62c9a54.