Skip to content

Nest chat-UI orchestration workers under the agent that started them - #34601

Merged
brennanb2025 merged 16 commits into
mainfrom
brennanb2025/chat-worker-lineage
Oct 28, 2026
Merged

brennanb2025 merged 16 commits into
mainfrom
brennanb2025/chat-worker-lineage

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1870 $\color{#cf222e}{\Huge{\mathbf{−}}}$​250 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1620
Prod 40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2003 $\color{#cf222e}{\Huge{\mathbf{−}}}$​151 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1852

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 at 203cb3c77b2; the later actual conflict was resolved by merge c7be9fcce32, preserving both reconciliation and main's changed-pane notifications.

  • Real DB/RPC assignment through projection, host row attachment and actual CLI main: ordinary/cold-readable chats, terminal controls, clear successors, coordinator generations, recency and private-key exclusion.
  • Production mirrored tabs/status through canonical receiving, actual-row joins, mounted sidebar/dashboard/Activity consumers and complete graph-feedback iteration. Targeted native tab-only admission also updates the mounted activity consumer with no orchestration context or second host event.
  • N/10N operation and render-locality contracts, including null-address history, unaffected rows and other-host updates. Selected-address verification uses at most three native statement executions while retaining indexed per-address seeks; exact-ineligible inactive selections add no verification work.
  • Admitted Windows benchmark passed all 18 records: 16 retained-history/fact/address corpora plus a coarse-window sweep. Output, query plans and operation counts were independently verified. The measured bounds do not establish flat latency or constant database work.
  • Merged-head CI passed: static analysis/typecheck, all five test shards, Mobile verify, relay integration, packaging, wire compatibility and all three WSL distros. Focused merge checks passed 86 tests plus 1,498 runtime tests with three existing skips. Normal repair hooks passed; the main merge used the required lint-staged check and permitted merge-commit exception.
  • Branch desktop and shipping native phone screenshots show one parent and one indented worker with readable labels and no duplicate/error overlay. The desktop uses the actual production-list fixture; the phone uses the actual branch bundle and native framebuffer with a scratch presentation host. Production DB/publication correctness is established separately by integration tests. The desktop screenshot command returned1 only for a favicon404; a separate DOM check found no component error.

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 30a8f2301ee and the fixture-only 65fa3aeae2d input, carried across the test-only 403cd583e8b/65fa3aeae2d commits and main merge c7be9fcce32. 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.

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.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 28, 2026 05:45
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent 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: eeaffe16-e257-4350-9371-41d415fad5ba
Commits

Reviewing files that changed from the base of the PR and between e3a08bb and a55e785.

Files selected for processing: 3
  • src/cli/index-omitted-host-scope-selectors.test.ts
  • src/renderer/src/components/sidebar/mirrored-terminal-lineage.test-fixture.tsx
  • src/renderer/src/components/sidebar/use-worktree-agent-rows-subscriptions.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

The changes add session-based dispatch selection and canonical session-pane resolution to runtime lineage projection. The renderer maps orchestration contexts to structured-session rows and worktrees, with producer-host checks and shared selectors. Dashboard, activity, sidebar, and mobile consumers use these projections. New tests cover runtime and renderer lineage, dispatch selection, snapshot updates, and synchronization behavior.

Priority: Normal

Merge Risk: Low · up to a55e7

Remapped or hydrated chat tabs can retain an outdated agent-row identity until another update refreshes the row. This bounded UI risk remains open.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 44.74% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description provides detailed problem, change, rationale, testing, review, performance, compatibility, and UI evidence context. However, it does not follow the required template headings and omits… Update the PR description to use the required template. Add the required issue link under Fixes # or provide the repository-approved linked issue format, attach or link the before/after visual proof in the PR under Visual Proof, complet…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly describes the main change: nesting chat-UI orchestration workers under their originating agent.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 44.74% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 38 functions across 48 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description provides detailed problem, change, rationale, testing, review, performance, compatibility, and UI evidence context. However, it does not follow the required template headings and omits or does not clearly complete required items such as an actual linked issue in the required format, Visual Proof with directly attached evidence or N/A, AI Disclosure when applicable, Review, Agent skill upstream boundary, Notes, and the Checklist.

Resolution

Update the PR description to use the required template. Add the required issue link under Fixes # or provide the repository-approved linked issue format, attach or link the before/after visual proof in the PR under Visual Proof, complete Testing, Review, Agent skill upstream boundary, Notes, and Checklist, and add the AI Disclosure section if the author is an external contributor or used AI.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Commits

Reviewing files that changed from the base of the PR and between 66e2d39 and 203cb3c.

Files selected for processing: 42
  • mobile/src/components/WorktreeAgentList.test.tsx
  • src/cli/index-omitted-host-scope-selectors.test.ts
  • src/main/runtime/construction/runtime-service-state.ts
  • src/main/runtime/orchestration/db/dispatch-context/dispatch-lookup.ts
  • src/main/runtime/orchestration/db/hot-path-statement-compilation.test.ts
  • src/main/runtime/orchestration/db/remaining-dispatch-statement-compilation.test.ts
  • src/main/runtime/orchestration/db/schema/schema-column-probes.ts
  • src/main/runtime/orchestration/orchestration-orca-session-column-migration.test.ts
  • src/main/runtime/orchestration/structured-session-lineage.ts
  • src/main/runtime/runtime-agent-lineage.test-fixture.ts
  • src/main/runtime/runtime-agent-orchestration-projection.test.ts
  • src/main/runtime/runtime-agent-orchestration-projection.ts
  • src/main/runtime/runtime-agent-orchestration-scope.ts
  • src/renderer/src/components/activity/activity-event-builder-sources.ts
  • src/renderer/src/components/activity/activity-event-builder.ts
  • src/renderer/src/components/activity/use-agent-pane-threads.ts
  • src/renderer/src/components/dashboard/build-dashboard-snapshot.ts
  • src/renderer/src/components/dashboard/useAgentBucketCounts.gate.test.ts
  • src/renderer/src/components/dashboard/useAgentBucketCounts.ts
  • src/renderer/src/components/dashboard/useLiveDashboardSnapshot.ts
  • src/renderer/src/components/dashboard/worktree-agent-rows-cache.ts
  • src/renderer/src/components/native-chat/structured-agent-session-tabs.ts
  • src/renderer/src/components/sidebar/WorkerLineage.fixture.tsx
  • src/renderer/src/components/sidebar/mirrored-terminal-lineage.test-fixture.tsx
  • src/renderer/src/components/sidebar/use-worktree-agent-rows-subscriptions.test.tsx
  • src/renderer/src/components/sidebar/useWorktreeAgentRows.ts
  • src/renderer/src/components/sidebar/worktree-agent-activity-summary.test.ts
  • src/renderer/src/components/sidebar/worktree-agent-activity-summary.ts
  • src/renderer/src/components/sidebar/worktree-agent-live-index-patch.ts
  • src/renderer/src/components/sidebar/worktree-agent-orchestration-index.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-fallback-tab.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-orchestration.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-selectors.ts
  • src/renderer/src/components/sidebar/worktree-agent-rows.ts
  • src/renderer/src/runtime/structured-agent-session-owner.ts
  • src/renderer/src/runtime/visible-agent-orchestration.ts
  • src/renderer/src/store/slices/agent-status/agent-status-live-entry-builder.ts
  • src/renderer/src/store/slices/agent-status/agent-status-orchestration-actions.ts
  • src/renderer/src/store/slices/agent-status/agent-status-retention-actions.ts
  • src/renderer/src/store/slices/agent-status/agent-status-slice-contract.ts
  • src/renderer/src/store/slices/workspace-cleanup-agent-evidence.ts
  • src/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.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Chat activity stays stale ▶

Summary

Publishes chat-worker relationships from durable assignments and joins canonical chat identities to the tabs each desktop displays.

  • Chat and terminal workers now nest under the chat rows that started them.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Durable assignments] --> B[Active or recent assignments]
  C[Committed clear successors] --> D[Canonical public chat keys]
  B --> D
  D --> E[Public orchestration contexts]
  E --> F[Host-qualified join to actual tabs]
  F --> G[Sidebar, dashboard and Activity]
  E --> H[CLI and phone rows]
Loading

Reviews (1) · Last reviewed commit: "Merge origin/main to resolve final PR co..." · Reviewed by Greptile

@brennanb2025

brennanb2025 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

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):

Nested desktop worker list

Shipping native phone list (production30a bundle, actual emulator framebuffer):

Nested worker in the shipping phone list

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.

@brennanb2025
brennanb2025 merged commit f0d55e7 into main Oct 28, 2026
48 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/chat-worker-lineage branch October 28, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant