Repository navigation
sessions: 🐛 Let the root stop a done dispatch in its own Orca Run - #320
Merged
Merged
Conversation
Claude-Session-Id: 0c0cf582-9d66-49b9-81f7-2bd1ff773bbd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: At 2:07 AM on October 6, 2026, the release-v3 drive root ran
orca orchestration worker-stop --dispatch ctx_a0f447e7e42cto end hsbc-routing-check, a lane it had already judged done.orca_ends_sessionblocked 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 sendworker_done, and asked for this hook to be fixed.Summary:
orca_ends_sessionallows one literalorca orchestration worker-stop --dispatch <ctx>when the caller is the main session whoseORCA_TERMINAL_HANDLEis the coordinator of that dispatch's Run. The guard reads the Run fromorca orchestration worker-showand the coordinator fromrun-show, using thecoordinates()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, andworker-release. Theworker-stopblock 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_terminaland the newstopped_dispatchsharelone_target, which accepts exactly one literal, non-expandable target.spelled()rejects calls the scan respelled from a loop, sofor d in …; do worker-stop --dispatch $dstill 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 missingworker-show, a loop, a&&chain,run-stop, andworker-release. The packs guide and the changelog record the narrowed rule.