Repository navigation
Conversation
A worker_done that Orca refuses left its worker Dispatch at state=ready, stage=input_accepted — the same reading as a worker that is still thinking. Nothing else moved that row, so a lane whose worker had already finished stayed green for the rest of the wave. A refused report from the assigned pane now parks the lane at stop_unknown with stage=worker_report_rejected and the rejection reason in last_error, so an audit can tell an ended Dispatch from a live one. Reports from a terminal that is not the assignee leave the lane untouched. A later accepted report still settles a parked lane, and a parked lane that loses its terminal still requeues its Task. Refs stablyai#13364
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe orchestration runtime now records rejected worker reports with a dedicated stage. Rejected ready workers move to 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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. Comment |
|
Moved to #15265 and closing this one — same branch, same commits, same head SHA, opened from a personal fork instead of an organisation-owned one. The reason is the one Jinwoo-H hit on #13639: GitHub does not grant maintainer push access on a fork owned by an organisation, even though the API reports Nothing about the change moved. This thread keeps the review history, and #15265 carries the code. |
What changes
A
worker_donethat Orca refuses now takes its worker Dispatch out ofready. A refused report from the assigned pane parks the lane atstate = stop_unknown,stage = worker_report_rejected, with the rejection reason inlast_error.Fixes #13364 (point 2 — "never leave the dispatch reading
ready").Evidence
Two traces of the same shape, from waves run against v1.4.176/v1.4.178.
2026-08-09. A supervised worker tried to report twice, twenty seconds apart. Both attempts came back rejected and were stored as
Rejected worker_done: … blocked at finish gatewith a body beginning "Orca rejected this worker_done". Its escalation went to the Run mailbox. The work itself was fine — the branch merged and the ticket closed three minutes later — butctx_5781041c767cstill readstate = ready, stage = input_acceptedhours afterwards, which is exactly what a live worker looks like. Two of that wave's nine dispatch contexts were in this state and nothing in Orca would ever have noticed.2026-08-10. Six workers finished their task and every
worker_donecame back rejected, because their dispatches had been revoked after a readiness timeout while the agents themselves ran to completion. The coordinator ended up detecting completion by reading files on disk, because the one channel that reports completion had refused all six.Why this branch and not the other one
The alternative was to leave the dispatch alone and make the rejection loud to the sender. That is already true on
main, so there was nothing to add:orchestration.sendreturnslifecycle: { action: 'rejected', code, reason }(orchestration.ts).Rejected <id>: <reason>(src/cli/handlers/orchestration.ts:592), covered byorchestration-lifecycle-rejection.test.ts.hasRemoteLifecycleRejection.The 2026-08-09 worker did learn — it retried, then escalated. What no one learned was that its lane had ended. So the gap is the dispatch row, not the sender.
How
markWorkerReportRejectedonOrchestrationDbis called from the two places aworker_donecan be refused after its sender has proved it owns the dispatch:orchestration.send. This branch returns beforereconcileLifecycleMessage, which is why the row was never touched. It is gated onhasLifecycleAuthority, so a terminal that is not the assignee cannot park someone else's lane by naming its dispatch id.settleWorkerReportInTransaction, forinactive_dispatchandstale_dispatch— the codes that mean this exact dispatch can no longer settle. This path is reached only after the authority check inreconcileWorkerDoneMessage, and it also covers reports that arrive over the federation relay.Rejections that cannot identify a lane the sender owns —
sender_not_assignee,unknown_dispatch,task_dispatch_mismatch, a malformed payload — leave the row alone.stop_unknownrather thanfailed:failedis inWORKER_RELEASABLE_STATES, so it would mark the agent's terminal reclaimable while the agent may still be running.stop_unknownkeeps the terminal retained and reads as "this ended and I do not know how", which is what a refused report actually tells us.worker-abandon— "fence a worker without claiming its process stopped" — still fences a parked lane in full.Two consequences handled in the same change, so the fix does not create a new way to strand things:
--dispatch-capability) still settles a parked lane, instead of completing the Task while the lane stays atstop_unknown.reconcileMissingWorkerTerminalstill requeues the Task for a parked lane. ItsstopWasPendingtest now excludes the report-rejected stage, because such a lane never had a stop requested.Nothing in readiness, revocation, the dispatch lifecycle, or the mailbox changes.
Test plan
New:
src/main/runtime/rpc/methods/orchestration-rejected-worker-report-lane.test.ts— 7 tests over a real supervised worker lane.Results on this branch:
The full
pnpm testrun also passed except for two timing assertions unrelated to this change (terminal-output-frame-chunks-equivalence,ai-vault-session-worktree-map), which the machine's load caused; both pass when re-run on their own.