Repository navigation
Read who each agent works with: its manager, workers and peers - #34890
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:
Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 7

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:
2855c4b4-5068-4471-984c-f1d6139db1d4
Files selected for processing: 124-
config/mobile-ci.vitest.config.mjsmobile/scripts/check-tests-typecheck-ratchet.mjsmobile/src/components/WorktreeAgentList.runtime-lineage.test.tsxmobile/tsconfig.test.jsonsrc/cli/index-omitted-host-scope-selectors.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-registry.tssrc/main/runtime/agent-session-record-store-slot.test.tssrc/main/runtime/agent-session-record-store-slot.tssrc/main/runtime/agent-session-store-transactions.test.tssrc/main/runtime/agent-session-store-transactions.tssrc/main/runtime/construction/runtime-construction-services.tssrc/main/runtime/construction/runtime-service-state.tssrc/main/runtime/dispatch-predicate-visits.test-fixture.tssrc/main/runtime/orca-runtime-agent-transitions.tssrc/main/runtime/orca-runtime-test-orchestration-messages.spec.tssrc/main/runtime/orca-runtime-test-scenario-builders.spec.tssrc/main/runtime/orca-runtime-tests/lineage-and-scan-cache-part-04.spec.tssrc/main/runtime/orca-runtime-tests/lineage-and-scan-cache-part-05.spec.tssrc/main/runtime/orca-runtime-tests/lineage-and-scan-cache-part-06.spec.tssrc/main/runtime/orca-runtime-tests/mobile-summaries.spec.tssrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-02.spec.tssrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.tssrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.tssrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.tssrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-05.spec.tssrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-06.spec.tssrc/main/runtime/orchestration/canonical-orca-session-id.tssrc/main/runtime/orchestration/crew/crew-changes.tssrc/main/runtime/orchestration/crew/crew-claim-origins.test.tssrc/main/runtime/orchestration/crew/crew-claim-reduction.tssrc/main/runtime/orchestration/crew/crew-cli-addresses.test.tssrc/main/runtime/orchestration/crew/crew-host-derivation.tssrc/main/runtime/orchestration/crew/crew-identity-inputs.tssrc/main/runtime/orchestration/crew/crew-mutation-notifications.tssrc/main/runtime/orchestration/crew/crew-parent-inputs.tssrc/main/runtime/orchestration/crew/crew-parent-persistence.test.tssrc/main/runtime/orchestration/crew/crew-parent-relations.test.tssrc/main/runtime/orchestration/crew/crew-parent-relations.tssrc/main/runtime/orchestration/crew/crew-parent-rpc.test.tssrc/main/runtime/orchestration/crew/crew-parties.tssrc/main/runtime/orchestration/crew/crew-party-snapshot.tssrc/main/runtime/orchestration/crew/crew-query.tssrc/main/runtime/orchestration/crew/crew-read-model-performance.test.tssrc/main/runtime/orchestration/crew/crew-read-model.test-fixture.tssrc/main/runtime/orchestration/crew/crew-read-model.test.tssrc/main/runtime/orchestration/crew/crew-read-model.tssrc/main/runtime/orchestration/crew/crew-rules.tssrc/main/runtime/orchestration/crew/crew-runtime-watch.tssrc/main/runtime/orchestration/crew/crew-source-inputs.tssrc/main/runtime/orchestration/crew/crew-stream.tssrc/main/runtime/orchestration/crew/crew-workspace-names.tssrc/main/runtime/orchestration/db/attach-orchestration-db-methods.tssrc/main/runtime/orchestration/db/dispatch-context/dispatch-lookup.tssrc/main/runtime/orchestration/db/hot-path-statement-compilation.test.tssrc/main/runtime/orchestration/db/orchestration-db.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/orchestration-sender-name.tssrc/main/runtime/orchestration/structured-session-lineage.tssrc/main/runtime/orchestration/terminal-pane-mail-routing.tssrc/main/runtime/rpc/methods/orchestration.tssrc/main/runtime/rpc/methods/orchestration/crew-methods.tssrc/main/runtime/runtime-agent-lineage-catalog.test-fixture.tssrc/main/runtime/runtime-agent-lineage.test-fixture.tssrc/main/runtime/runtime-agent-orchestration-benchmark.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/main/runtime/runtime-orchestration-crew-names.test.tssrc/main/runtime/runtime-orchestration-db.test-fixture.tssrc/main/runtime/runtime-orchestration-sender-names.test.tssrc/main/runtime/runtime-orchestration-sender-names.tssrc/main/runtime/session-graph/visible-graph-changed-worktrees.tssrc/main/runtime/session-lifecycle/projection/prune-mobile-session-tab-group-layout.tssrc/main/runtime/session-tabs/session-tabs-inventory.tssrc/main/runtime/terminal-send-stale-leaf-liveness.test.tssrc/main/runtime/terminal/adoption/adopt-terminal-orphans-from-inventory.tssrc/main/runtime/terminal/identity/terminal-handle-bindings.tssrc/main/runtime/terminal/output/headless-buffer-snapshot.tssrc/main/runtime/terminal/output/terminal-orchestration-authority.tssrc/main/runtime/terminal/query/pty-terminal-summary.tssrc/main/runtime/terminal/query/terminal-identity-read-context.test.tssrc/main/runtime/terminal/query/terminal-identity-read-context.tssrc/main/runtime/terminal/surface/main-terminal-acquisition.test.tssrc/main/runtime/terminal/surface/main-terminal-surfaces.tssrc/main/runtime/terminal/surface/pty-pane-query.tssrc/main/runtime/terminal/wait/terminal-interactive-wait.tssrc/main/runtime/workspaces/persisted-surfaces/automation-operations.tssrc/main/runtime/workspaces/session-hosts/get-runtime-id.tssrc/main/runtime/workspaces/workspace-process-listing.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/WorktreeCard.affiliate-list-mode.test.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.tssrc/shared/orchestration-agent-reference.tssrc/shared/orchestration-crew.tssrc/shared/runtime-agent-lineage-consumer.test-fixture.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
-
…d-model # Conflicts: # src/main/runtime/rpc/methods/orchestration/messaging/worker-follow-up.ts
Keep the real CLI/RPC/database command paths, one regression per review-found bug, the cross-version contracts and one N vs 10N operation contract per scaling piece. Drop permutation matrices, equivalence oracles, near-duplicate scenarios and diagnostic output, and return the SSH, managed-server and WSL test files to main, since their production changes were reverted earlier in this PR.
Remove two leftover console.log diagnostics, an unused 2x2 sample matrix and unused return fields in the follow-up cost contract, and the subscription AbortError serialization case that the subscription identity and preload tests already cover.
Resolve conflicts with main's agent-session records move, terminal sender snapshots, and pane-shown retained handles, and update one identity test for main's rule that an alias no pane shows answers only exit waits.
Main's hosted-review routing grew the workspace loader past its line limit alongside this branch's recorded-leaf reader, so the reader moves into the recorded-key module it already depends on.
…ó do upstream O sync de 2026-11-01 parou no pai de stablyai#34890 porque automation-operations.ts, idêntico ao do upstream, passou do max-lines no hook de pre-commit. Documenta o procedimento no runbook e no AGENTS.md e atualiza o parágrafo do plugin-authoring.md, que o upstream passou a trazer com a mesma formatação.
Main now takes the source as the first argument (stablyai#34890).
Main now takes the source as the first argument (stablyai#34890).
Main now takes the source as the first argument (stablyai#34890).
Problem and change
Orca has no single view of who an agent works with. Its manager, workers, conversations and unanswered questions live in separate records, so a panel cannot safely infer them from terminal labels or recent activity alone.
This PR supplies a read-only Crew view for each agent, using the existing host records and streaming transport. It keeps durable relationships separate from optional actions: a known agent can remain visible even when Orca cannot prove an address or an Open target for it. Pending questions belong to their recipient and do not disappear just because unrelated messages become old. Status and ownership changes refresh the view through existing event sources, without per-row polling or a saved roster. Passive observation does not launch, repair or redeploy a host.
Users see nothing from this PR alone: merging it alone ships an internal read model that can't be used until #34891 adds the panel; #34836 adds mentions. The base feature #34601 has landed, and this PR now targets main.
Design
The common pattern derives relationships from canonical records and keeps display data separate from action authority. This adopts that pattern. Intended differences cover existing terminal and native-chat agents, Run and Dispatch ownership, retained sessions, folder workspaces and independently updated paired hosts. Managed by follows proven durable parent assignments; Managing uses the existing active/recent worker lifecycle. Incomparable proven parents can both remain visible. An unsupported older host keeps its existing behavior and does not show the panel.
The view reuses generation-owned acquisition and the existing status/identity authorities. Selected revisions invalidate the relevant host or party; consumers share sources and release them with their final interest. Optional addresses are checked against the existing command contract rather than a new permission cache: Crew offers a follow-up address only when the messaging command's own checks for the current Run, the helpers the caller may continue and the nesting-depth limit would accept it.
Validation
Source-associated tests cover the real public command, relationship and question lifecycle, current identity, selected acquisition, fault/retry/disposal and operation bounds. The public command's four kept cases pass, including a worker sending through the actual Crew-advertised address to its settled, still-live helper. Previously accepted app evidence covers the unchanged saved-identity, paired-host and observation flows; it is carried by flow and source, not presented as a new full run.
Settled-parent address repair. With nested delegation enabled, Crew could offer an active child its settled parent's Dispatch address even though the command does not permit the child to continue the parent's work. Production commit
c47cc349c6843c17a3dd3bf86f1902dccd2b22a2uses the command's full checks for the current Run, which helpers the caller may continue and the nesting-depth limit before offering an address. It preserves the relationship and valid Open target, the existing same-party ordinary-message route, and the explicit foreign-helper refusal. Its regression lets the parent report done, captures Crew's actual address, sends that exact string through the real CLI → RPC → database path, and confirms an explicit send to the parent's Dispatch is still refused with no effects. This is a separate Crew repair after the main helper-command fix in #36663; it does not relax that ownership rule.Construction recorded 145 passing tests in 16 complete files before small static fixes, then 15 of those same tests in four complete files on the exact committed bytes; the 15 are a subset, not additional tests. Test-only
ac182c1dc6343211fa5edaedb5a2adbdcd90e3becompletes the selected finite performance and recovery evidence: 20/20 passed across three whole files, recording actual work as targets, custody history and remote candidates grow independently, a warm custody transfer with queued-update cancellation, and a partial read failure that shows as unknown and then recovers on retry. Test-only9ef08d3b9fecf779840bf303f628039d855c3303makes the direct remote case assert the exact thrown error object; 7/7 passed in its whole file. These command and database fixtures do not establish a new app run, an OS-agent read or a provider response, and they do not prove universal latency, CPU, heap or GC bounds.Ordinary merge
25af5a8e97396791e0aa9abaf6c422de4b302174brings in main21c86904d5d353b888d5848917c85f789e88ab31. Its only conflict, in the WSL host runtime call, keeps main's protection against a stale stopped status overwriting a newer Start; 55/55 passed across the two whole WSL host service and pending-removal test files, and the full merge hook passed. CI on that merge failed its static job on one duplicate import in a Crew test file, so its later compiler, casting and E2E ratchet steps did not run there. Test-only19fc72a1066fdaaf2d24873ccad0cb583144cb05merges that import into the existing one without changing any test body; it is this PR's final source, and its CI result is green. Earlier CI ate1ded7135a24db2264908542c08e855215ddfd92was green, including all five configured compiler programs, the unchanged E2E typecheck ratchet and all 12 unit shards; configured skips remain skips. That result does not cover later heads.The main command repair in #36663 is a fixed external dependency, included by ordinary merge and propagated through the stack without a Crew fallback or helper-policy workaround. Its earlier regression successfully sends to Crew's advertised address for an active worker's settled helper, reusing its resource with one prompt and no new terminal; all 59 tests passed across four complete command/authority files at that earlier head. That evidence keeps its own source association and is distinct from the settled-parent repair above. #34891 at
e30ada67cf76d62a6a1a0e815fd783b9ea6d42fdand #34836 atb22995b3e0ae51838eb7f55007747a2fbcf52a30carry this PR's source by ordinary merge.Test trim. Tests-only commits
668570384ade63d232c409fa741e0d46d95e616dandd7e268cd0f39a0ded1f76382b3c7b863936bb660cut this PR's added test lines from 16,373 to 7,896, now below its 8,008 added production lines. They keep the real CLI → RPC → database command paths, one regression per bug the review found, the cross-version and wire contracts, and one N vs 10N operation-count contract per scaling piece. They drop permutation matrices, equivalence oracles, near-duplicate cases, diagnostic output, five whole test files, and the SSH, managed-server and WSL test additions (those production changes were reverted earlier in this PR, or main's existing tests already cover them). All 40 edited test files that remain pass locally (255 tests). No production file changed.Ordinary main merges
57ef7f21b86(main274592eddc3, 12 conflicts resolved, keeping both sides) andc31c8535f2c(mainbe3d9b7e863, no conflicts) follow the trim. Test-onlya0f1593ab2apasses the recorded-leaf reader in main's new check-details loader test. CI ona0f1593ab2ais green. CI on19fc72a1066fdaaf2d24873ccad0cb583144cb05, the last head before the trim, was green: all twelve unit shards, the five configured compiler programs, changed-code casting/quality and the unchanged zero-baseline E2E typecheck ratchet passed. Configured skips remain skips. The first attempt timed out in main's unchanged 1,000-turn observer test and then failed its next test; a failed-job-only retry passed all 15 observer tests, with the 1,000-turn case completing in 22.393 seconds. No stack code was changed for that timing failure.