Repository navigation
Let send talk to a worker in any state, reopening closed workers for follow-ups - #36533
Conversation
A send to a finished worker's Dispatch becomes its next Task, started the way worker-start starts one: in place while its tab is open, reopened in its saved conversation once closed, or as a fresh agent with the earlier task and report when no conversation was kept. Mail a worker never read before it reported becomes that follow-up too. Kept-open workers take follow-ups and stay kept.
…e the conversation at stop and release, and show followUpOf A card in Orca's own worker chat runs when that turn ends, so it reads as ready instead of outcome_unknown; a user's chat keeps the unknown reading. The terminal conversation is also saved before stop and release close the pane, so a worker that stopped without reporting or ran /clear reopens its latest one.
Unread mail a worker left when it reported is marked in that settlement, read in the follow-up's own claim, and steered into a racing follow-up instead; startup and report replay continue what a restart interrupted. A send to a working worker stays synchronous until its mail is inserted. Follow-ups read the worker's terminal through worker inspection, refuse while it is unverifiable, close an Orca shell whose agent exited, and fall back to a fresh agent when a resume is refused before spawning. The send's pending receipt names the follow-up it accepted; a failed follow-up continues the worker before it; a worker pane's conversation is saved whenever its agent reports a new one.
…to the follow-up, and write the saved conversation without comparing
|
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: 3

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:
402ccfd7-92a7-4063-80d0-5f771cf1b42e
Files selected for processing: 56-
skill-guides/orchestration.mdskill-guides/orchestration/references/coordinator-loop.mdskill-guides/orchestration/references/low-level-topology.mdsrc/cli/bundled-skill-guides.tssrc/cli/handlers/orchestration/message-send-handler.tssrc/cli/handlers/orchestration/worker-observation-handlers.tssrc/cli/runtime/client.tssrc/cli/specs/orchestration-worker-specs.tssrc/main/runtime/orca-runtime-agent-transitions.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/db/contract-constants.tssrc/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.tssrc/main/runtime/orchestration/db/dispatch-context/worker-report-settlement.tssrc/main/runtime/orchestration/db/dispatch-row-writer.tssrc/main/runtime/orchestration/db/row-column-lists.tssrc/main/runtime/orchestration/db/schema/create-core-tables-sql.tssrc/main/runtime/orchestration/db/schema/create-graph-tables-sql.tssrc/main/runtime/orchestration/db/schema/migrate-v46.tssrc/main/runtime/orchestration/db/schema/migrate.tssrc/main/runtime/orchestration/db/worker-dispatch/worker-dispatch-start.tssrc/main/runtime/orchestration/db/worker-terminal/worker-terminal-resource-store.tssrc/main/runtime/orchestration/db/worker-terminal/worker-terminal-transfer.tssrc/main/runtime/orchestration/db/worker-terminal/worker-terminal-user-keep.tssrc/main/runtime/orchestration/orchestration-schema-version-skew.tssrc/main/runtime/orchestration/structured-session-mail-target.test.tssrc/main/runtime/orchestration/types.tssrc/main/runtime/orchestration/worker-terminal-ownership.tssrc/main/runtime/rpc/methods/orchestration/federation/federated-worker-show.tssrc/main/runtime/rpc/methods/orchestration/messaging/send-control-mail.tssrc/main/runtime/rpc/methods/orchestration/messaging/send-methods.tssrc/main/runtime/rpc/methods/orchestration/messaging/settled-worker-follow-through.tssrc/main/runtime/rpc/methods/orchestration/messaging/worker-follow-up-receipt.tssrc/main/runtime/rpc/methods/orchestration/messaging/worker-follow-up.tssrc/main/runtime/rpc/methods/orchestration/worker/deliver-worker-dispatch-preamble.tssrc/main/runtime/rpc/methods/orchestration/worker/dispatch-context-exposure.tssrc/main/runtime/rpc/methods/orchestration/worker/local-worker-start-dispatch.tssrc/main/runtime/rpc/methods/orchestration/worker/local-worker-start.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-auto-release.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-control.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up-choice.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up-placement.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-observation.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-observation.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-release-archive-capture.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-release-archive.spec.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-resume-session-capture.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-agent-placement.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-turn-observation.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-stop-archive.tssrc/main/runtime/rpc/methods/orchestration/worker/workers.tssrc/main/runtime/rpc/orchestration-mutation-receipt.tssrc/main/runtime/runtime-orchestration-db.test-fixture.tssrc/main/runtime/structured-chat-worker-reuse.test.tssrc/main/runtime/workspaces/persisted-surfaces/automation-operations.ts
Files with no reviewable changes: 1-
- skill-guides/orchestration/references/coordinator-loop.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
…e follow-up modules
There was a problem hiding this comment.
Actionable comments posted: 3

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:
3e849e12-1592-4937-8ce6-fd3a38561475
Files selected for processing: 12-
src/cli/handlers/orchestration/message-send-handler.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.tssrc/main/runtime/rpc/methods/orchestration/messaging/send-methods.tssrc/main/runtime/rpc/methods/orchestration/messaging/settled-worker-follow-through.tssrc/main/runtime/rpc/methods/orchestration/messaging/worker-follow-up.tssrc/main/runtime/rpc/methods/orchestration/worker/local-worker-start.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-earlier-work.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up-choice.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up-placement.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up.test.tssrc/main/runtime/structured-chat-worker-reuse.test.ts
Files with no reviewable changes: 2-
- src/main/runtime/rpc/methods/orchestration/worker/worker-earlier-work.ts
- src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
… prove a worker exited before replacing it, and keep each message's subject
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:
f8155a04-e6c8-4d8e-b943-bc2db846b050
Files selected for processing: 4-
src/main/runtime/rpc/methods/orchestration/messaging/send-methods.tssrc/main/runtime/rpc/methods/orchestration/messaging/settled-worker-follow-through.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up-choice.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
… paired-server refusals by state, and resolve follow-up recovery commands in JSON
There was a problem hiding this comment.
Actionable comments posted: 2

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:
1e55eb5c-53e0-44e8-b639-f1017e5bc3e2
Files selected for processing: 10-
skill-guides/orchestration.mdsrc/cli/bundled-skill-guides.tssrc/cli/handlers/orchestration/message-send-handler.tssrc/cli/handlers/orchestration/worker-launch-handler.tssrc/cli/orchestration-mutation-recovery.tssrc/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.tssrc/main/runtime/rpc/methods/orchestration/messaging/send-control-mail.tssrc/main/runtime/rpc/methods/orchestration/messaging/send-methods.tssrc/main/runtime/rpc/methods/orchestration/messaging/settled-worker-follow-through.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-follow-up.test.ts
Files skipped from review as they are similar to previous changes: 5-
- src/main/runtime/rpc/methods/orchestration/messaging/send-control-mail.ts
- src/cli/bundled-skill-guides.ts
- src/main/runtime/rpc/methods/orchestration/worker/worker-follow-up.test.ts
- src/main/runtime/rpc/methods/orchestration/messaging/send-methods.ts
- src/main/runtime/rpc/methods/orchestration/messaging/settled-worker-follow-through.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
-
… pane identity changed, and test the follow-up mode line
…e worker's address delivers it
…w-up, delivered once that one is ready or has reported
…its start cannot strand it
# Conflicts: # skill-guides/orchestration.md # skill-guides/orchestration/references/coordinator-loop.md # src/cli/bundled-skill-guides.ts # src/cli/handlers/orchestration/message-send-handler.ts # src/cli/handlers/orchestration/worker-launch-handler.ts # src/cli/handlers/orchestration/worker-observation-handlers.ts
# Conflicts: # skill-guides/orchestration.md # src/cli/bundled-skill-guides.ts # src/cli/handlers/orchestration/worker-launch-handler.ts
…d skip writes that repeat it
ELI5
A coordinator talks to its workers with
orca orchestration send --to dispatch:<id>. Until now that only worked while the worker was still on its task: once a worker finished,sendwas refused, and if its tab had auto-closed there was no way back to it. Nowsendworks whatever state the worker is in. Orca steers a working worker, gives a finished worker a follow-up task in place, or reopens a closed worker in its saved conversation and gives it the task there.What Changed
sendto a finished worker creates a follow-up Task and Dispatch (follow_up_of_dispatch_id) throughworker-starton the sender's behalf, so the same Run checks and custody rules apply.sendreturns that worker-start receipt (and prints it as worker-start does) plusfollowUpOfand adeliverythat says what happened:worker_donebecomes or joins the follow-up, and mail moved to a follow-up wakes it like any Dispatch mail (durable across restarts, and a repeat startup pass does nothing); a send racing a report never gets the old "Dispatch is completed" refusal.follow_up_of_dispatch_id,follow_up_mail_at, saved resume session); the worker's conversation is saved on provider-session changes, atworker_done, and before stop and release;worker-showshowsfollowUpOf; restart recovery of an in-flight follow-up names its Dispatch.inspectWorkerTerminal(including handle re-mint); if Orca can't tell whether the old agent still runs, the send is refused rather than starting a second worker. An Orca-owned pane whose agent exited is released before its replacement starts.worker-start --on <server>; steering running workers works as before.worker-start, talk to them withsend, answer questions withreply;worker-retainis no longer taught for follow-ups.Why
Agents reach for
sendto talk to a worker. Requiring them to know whether it is still working, finished, or closed (and to switch toworker-start --terminalwith a handle, or start over) was a dead end in field use. Making a follow-up aworker-startrun for the same worker reuses the existing start, custody and recovery machinery instead of a parallel path.Linked Issue
None.
Visual Proof
N/A: no UI change beyond the reopened tab. Real app, isolated profile: terminal Claude workers followed up while open, after closing (resumed, history visible) and in the user's own tab; a chat worker reopened in the same chat and recalled the earlier exchange; kept-open worker follow-up; fresh start; the
worker_donerace. Receipts and database dumps were captured for each.Testing
worker-follow-up.test.tsand related: unread mail across a restart (including mail moved to the follow-up that won, woken once), stale handle after restart (no second worker), send racing a report, follow-up of a failed follow-up, conversation saved after/clear, queued chat follow-up counted as started, kept-open follow-up, older paired server refusal.pnpm check:changed --maxWorkers=2passes.Notes
Checklist
pnpm check:changedpasses; CI covers the rest