Repository navigation
Nest chat-UI orchestration workers under the agent that started them - #34601
Conversation
Main's lineage projection only walked terminal panes, so workers running in the chat UI never got a parent link and listed flat in the sidebar. It now also projects chat workers, keyed by their visible chat row, and resolves a chat creator or coordinator to that chat's visible row instead of its handle or private mailbox pane key.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b2ab6c38-cb37-4d6c-8bcb-8111c8f3309c
Files selected for processing: 42-
mobile/src/components/WorktreeAgentList.test.tsxsrc/cli/index-omitted-host-scope-selectors.test.tssrc/main/runtime/construction/runtime-service-state.tssrc/main/runtime/orchestration/db/dispatch-context/dispatch-lookup.tssrc/main/runtime/orchestration/db/hot-path-statement-compilation.test.tssrc/main/runtime/orchestration/db/remaining-dispatch-statement-compilation.test.tssrc/main/runtime/orchestration/db/schema/schema-column-probes.tssrc/main/runtime/orchestration/orchestration-orca-session-column-migration.test.tssrc/main/runtime/orchestration/structured-session-lineage.tssrc/main/runtime/runtime-agent-lineage.test-fixture.tssrc/main/runtime/runtime-agent-orchestration-projection.test.tssrc/main/runtime/runtime-agent-orchestration-projection.tssrc/main/runtime/runtime-agent-orchestration-scope.tssrc/renderer/src/components/activity/activity-event-builder-sources.tssrc/renderer/src/components/activity/activity-event-builder.tssrc/renderer/src/components/activity/use-agent-pane-threads.tssrc/renderer/src/components/dashboard/build-dashboard-snapshot.tssrc/renderer/src/components/dashboard/useAgentBucketCounts.gate.test.tssrc/renderer/src/components/dashboard/useAgentBucketCounts.tssrc/renderer/src/components/dashboard/useLiveDashboardSnapshot.tssrc/renderer/src/components/dashboard/worktree-agent-rows-cache.tssrc/renderer/src/components/native-chat/structured-agent-session-tabs.tssrc/renderer/src/components/sidebar/WorkerLineage.fixture.tsxsrc/renderer/src/components/sidebar/mirrored-terminal-lineage.test-fixture.tsxsrc/renderer/src/components/sidebar/use-worktree-agent-rows-subscriptions.test.tsxsrc/renderer/src/components/sidebar/useWorktreeAgentRows.tssrc/renderer/src/components/sidebar/worktree-agent-activity-summary.test.tssrc/renderer/src/components/sidebar/worktree-agent-activity-summary.tssrc/renderer/src/components/sidebar/worktree-agent-live-index-patch.tssrc/renderer/src/components/sidebar/worktree-agent-orchestration-index.tssrc/renderer/src/components/sidebar/worktree-agent-row-fallback-tab.tssrc/renderer/src/components/sidebar/worktree-agent-row-orchestration.tssrc/renderer/src/components/sidebar/worktree-agent-row-selectors.tssrc/renderer/src/components/sidebar/worktree-agent-rows.tssrc/renderer/src/runtime/structured-agent-session-owner.tssrc/renderer/src/runtime/visible-agent-orchestration.tssrc/renderer/src/store/slices/agent-status/agent-status-live-entry-builder.tssrc/renderer/src/store/slices/agent-status/agent-status-orchestration-actions.tssrc/renderer/src/store/slices/agent-status/agent-status-retention-actions.tssrc/renderer/src/store/slices/agent-status/agent-status-slice-contract.tssrc/renderer/src/store/slices/workspace-cleanup-agent-evidence.tssrc/shared/agent-status-worktree-attribution.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-
[Medium impact] The PR changes how orchestration relationships appear across the agent views. The reviewed changes appear safe to merge, with a non-blocking activity-summary cache fix recommended. Findings
SummaryPublishes chat-worker relationships from durable assignments and joins canonical chat identities to the tabs each desktop displays.
|
|
Chat workers appeared as peers of their coordinator because public relationships depended on private worker registrations and assumed a default chat tab identity. This change derives relationships from durable assignments and joins them to the rows each client actually displays. Chat and terminal workers now share the existing nested lists; private worker handles and mailbox panes stay out of public output. The full review loop fixed restored/existing-chat coverage, represented-tab and producing-host joins, stale coordinator generations, repeated ancestry/database work and unrelated-row invalidation. The design panel and later size re-plan settled the implementation. Independent correctness, consumer, reference, performance and readiness checks found no remaining source defect. No deferred user-visible issue or temporary design difference remains. The tab-only activity-cache report was refuted through the actual native bridge and mounted consumer: admission advances the existing status epoch without another host event or orchestration context. Verification: actual DB/RPC/CLI and phone-consumer integration; mounted sidebar/dashboard/Activity and graph-feedback contracts; N/10N operation and render locality; all 18 records of an admitted retained-history benchmark; merged-head CI including static/typecheck, all five test shards, Mobile verify, packaging and wire compatibility. The benchmark validates the measured bounds, not constant work or flat latency. No live-agent or lifecycle QA round was required or run. Benchmark setup used the machine's normal home/store for dependency installation; the measured child used isolated homes, no app was launched and config hashes were unchanged. For Brennan's review: Desktop compact list (exact production-list fixture at65fa): Shipping native phone list (production30a bundle, actual emulator framebuffer):
These establish presentation; actual DB/publication correctness is covered by the integration tests above. The desktop capture command returned1 for a favicon404; a separate DOM check found no component error. The native phone used a scratch presentation host and the real branch bundle. Reviewed head is c7be9fc. Screenshots use production30a8f2301eeea6eb38e7498c1ded22f786d799bf and the fixture-only65fa3aeae2d2df6a79c65a10f6d50d8acf4d6375 input. Later403cd583e8b and65fa3aeae2d change only test/fixture files; mergec7be9fcce32 integrates current main with the changed-pane notification contract. Required QA evidence carries across these commits; final CI checks the merged head. The later desktop fixture composition is a tests-row presentation change and has its own completed65fa screenshot; the orchestration/main flows have their real DB/RPC/CLI, mounted-consumer and graph-feedback tests on the merged head. Judgment points: durable assignment projection, selection and exact recency before indexed verification, and host-qualified represented-row adaptation. |


Problem
Chat workers assigned by orchestration appeared flat beside their coordinator in the workspace agent list. The projection only covered terminal/private worker registrations, and a session-derived default key could differ from the tab a client actually displayed. Terminal workers under chat coordinators could also lose their parent.
Change
Publish public relationships from durable assignments, including existing chats and readable restored sessions. Main, worktree RPC/CLI and phone keep canonical public chat keys; desktop joins them to its actual represented tabs using the producing host. Chat and terminal workers now use the existing nested lists, including retained and collision-suffixed tabs. Private worker handles and mailbox panes remain excluded from public output.
The projection shares clear-successor and database reads per build, respects generation-stamped coordinators, and bounds active/recent assignment selection with one guarded derived index. The renderer preserves equal contexts and unaffected row selections. No saved or wire field, schema-version bump, authority warmup, lifecycle change or new setting is introduced.
This follows the common pattern of public parent identities and read-time joins to represented rows. Intended adaptations preserve terminal pane identities, assignment-scoped active/recent lifetime, committed historical clear successors, mixed-writer coordinator stamps, independently chosen client tabs, multiple hosts and existing missing-parent roots.
Tracked in #27304.
Review and validation
Full review path: this changes the orchestration runtime and identity projection. Independent correctness, consumer, architecture, performance, reference and readiness reviews are complete on
c7be9fcce32. Three binding design rulings were implemented and verified. Main was synced at203cb3c77b2; the later actual conflict was resolved by mergec7be9fcce32, preserving both reconciliation and main's changed-pane notifications.QA classification is tests for orchestration, performance and existing desktop/phone nesting. No live-agent or lifecycle QA round was required or claimed. Proof uses production
30a8f2301eeand the fixture-only65fa3aeae2dinput, carried across the test-only403cd583e8b/65fa3aeae2dcommits and main mergec7be9fcce32. The full review comment links both images and records the evidence limits. All owned QA processes and terminals are closed; the evidence checkout is preserved.