Skip to content

sessions: 🐛 Let the root stop a done dispatch in its own Orca Run - #320

Merged
yasyf merged 1 commit into
mainfrom
fix/orca-root-stops-own-dispatch
Oct 6, 2026
Merged

yasyf merged 1 commit into
mainfrom
fix/orca-root-stops-own-dispatch

Conversation

@yasyf

@yasyf yasyf commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Context: At 2:07 AM on October 6, 2026, the release-v3 drive root ran orca orchestration worker-stop --dispatch ctx_a0f447e7e42c to end hsbc-routing-check, a lane it had already judged done. orca_ends_session blocked the call with "worker-stop ends the worker or run … leave ending them to the owner." The owner then ruled in cc-notes answer edfa70e that the root stops a done lane itself instead of messaging it to send worker_done, and asked for this hook to be fixed.

Summary: orca_ends_session allows one literal orca orchestration worker-stop --dispatch <ctx> when the caller is the main session whose ORCA_TERMINAL_HANDLE is the coordinator of that dispatch's Run. The guard reads the Run from orca orchestration worker-show and the coordinator from run-show, using the coordinates() check the settled-close lift already relies on. Every other case stays blocked: lane terminals, in-process subagents, dispatches in another Run, an unreadable dispatch, loop-respelled or conditional calls, run-stop, coordinator-stop, and worker-release. The worker-stop block message names the allowed route.

Motivation: The root decides when a lane is done: stood down, superseded, or its deliverable on disk. Making it signal the lane to report completion first adds a round trip and gains no safety, because the root already owns the Run. pkill, signals, and terminal closes are untouched.

Details: closed_terminal and the new stopped_dispatch share lone_target, which accepts exactly one literal, non-expandable target. spelled() rejects calls the scan respelled from a loop, so for d in …; do worker-stop --dispatch $d still blocks. The inline tests pin the 2:07 AM refusal as an Allow for the coordinating root, plus Blocks for a lane terminal, a subagent, another Run, a missing worker-show, a loop, a && chain, run-stop, and worker-release. The packs guide and the changelog record the narrowed rule.

Claude-Session-Id: 0c0cf582-9d66-49b9-81f7-2bd1ff773bbd
@yasyf
yasyf merged commit 4d13bf7 into main Oct 6, 2026
23 checks passed
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