Repository navigation
Description
Short summary
The orchestration auto-complete contract for worker_done is real but is enforced only softly, only at reconcile time, and is undocumented in the CLI. A worker_done that arrives without taskId / dispatchId is silently dropped with a warning log — before any terminal-based reconciliation — so any worker that does not follow the stock preamble verbatim (custom harness, non-LLM agent, hand-typed command) silently fails to complete its task. There is no error at send time and no terminal fallback.
What happened
Ran a coordinator-managed DAG with 8 parallel worker terminals (one per worktree), each dispatched via orca orchestration dispatch. Every worker finished and emitted worker_done, but all 8 arrived with:
taskId: null
dispatchId: null
None of the 8 tasks auto-completed; each had to be closed by hand with orca orchestration task-update --status completed. The workers were driven through a custom harness that did not run the stock preamble verbatim, so this is partly on my side — but the failure mode is entirely silent, which is the actual problem.
How to reproduce
orca orchestration task-create --title demo→task_<id>orca orchestration dispatch --task <id> --terminal <handle> --inject- Have the worker complete the work and emit
worker_donewithout explicitly settingtaskId/dispatchId(e.g. a custom harness that hand-crafts--payload '{}', or any worker that does not follow the stock preamble verbatim). orca orchestration task-list→ the task stays in dispatched/running state; it never auto-completes.
What the code does today (context for whoever picks this up)
reconcileWorkerDoneMessage(src/main/runtime/orchestration/lifecycle-reconciliation.ts) is a four-factor authority check: payloadtaskIdnon-empty, payloaddispatchIdnon-empty, the dispatch context'sassignee_handleequalsmsg.from_handle, and that dispatch is the current in-flight one. If either id is missing/empty, it returns{ action: 'ignored' }with aWarning: worker_done without taskId/dispatchId from <handle>log line, before the terminal-ownership check — so a null-idworker_doneis dropped even when it came from the terminal that owns the live dispatch.- The dispatch preamble (
buildDispatchPreambleinsrc/main/runtime/orchestration/preamble.ts) does hardcode the real--task-id/--dispatch-idinto the exampleorchestration sendcommand, so a worker that runs the stock preamble sends the ids. The gap is everything else. dispatch --help/send --help(src/cli/specs/orchestration.ts) do not document thatworker_donemust carry the matching ids for auto-complete.taskId/dispatchIdare not on theSendParams/MessageRowschema (src/main/runtime/rpc/methods/orchestration.ts,src/main/runtime/orchestration/types.ts) —payloadis an opaquestring | null. The ids exist only as CLI flags assembled into the JSON blob with no validation.- There is no
--require-payload-idsopt-in or anysend-time rejection of null-id lifecycle messages.
Expected
At least one of (the first two are the highest leverage):
- reject null-id
worker_done(and other lifecycle types) atsendtime with a clear error, so a misbehaving worker fails loudly instead of silently; - when a
worker_donearrives with null ids, reconcile against the single in-flight dispatch onmsg.from_handleand complete that, instead of dropping; - document the auto-complete contract in
dispatch --help/send --help(thatworker_donemust carry the matchingtaskId+dispatchId).
Anything else that might help
- Orca v1.4.121, macOS (Apple Silicon)
- 8 parallel workers, custom harness (did not run the stock preamble verbatim)
- Related issues (different axis — terminal lifecycle/reuse, not contract enforcement): Should coordinator-created orchestration worker terminals close after worker_done? #6478, [Bug]: WSL OMP orchestration worker is not reusable after worker_done #7377
Activity
nwparker commentedon Jul 18, 2026
Status: REPRODUCED (unit test)
reconcileWorkerDoneMessageinsrc/main/runtime/orchestration/lifecycle-reconciliation.tsreturns{action:'ignored'}at lines 173-183 wheneverpayload.taskIdorpayload.dispatchIdis missing — before the pane/handle ownership check (hasLifecycleAuthority, line 204). Because the ids are the only key used to look up the dispatch and there is no fallback, aworker_doneemitted from the exact pane that owns the sole in-flight dispatch is silently dropped (warning log only, no send-time error) and the task never auto-completes. Confirmed against the realOrchestrationDb: a null-idworker_donefrom the owning pane staysdispatched, while the identical message with the ids completes.Re-run:
Key files:
src/main/runtime/orchestration/lifecycle-reconciliation.ts(reconcileWorkerDoneMessage 173-183),db.ts(getDispatchContext),preamble.ts. Repro test + writeup:docs/bug-reproductions/7429.md.Fix direction: when ids are absent, reconcile against the single in-flight dispatch owned by
from_handle/sender_pane_keyinstead of returningignoredbefore the ownership check; and/or reject null-id lifecycle messages at send time.Automated bug-reproduction pass. Repro artifact committed on branch
nwparker/bug-repro-pass2; check it out to run the command above. Writeup:docs/bug-reproductions/7429.md.nwparker commentedon Jul 21, 2026
@Jinwoo-H may agent did some work but giving this to you
rodboev commentedon Sep 5, 2026
Closing this issue because current
mainnow rejectsworker_donemessages without both task and dispatch IDs and verifies dispatch ownership before settlement.nwparker commentedon Sep 27, 2026
Resolved in current main.
worker_donewithout a JSON payload, taskId, dispatchId, or valid outcome is now converted into a persisted lifecycle rejection; the CLI waits for settlement and surfaces that rejection instead of reporting a successful dispatch. Current orchestration help documents the required task/dispatch IDs and assignee ownership contract. The reconciliation tests cover missing-ID rejection.