sessions: 🐛 Let the root interrupt its own Orca lane - #321
Merged
Merged
Conversation
Context: At 8:29 AM on October 6, 2026, the release-v3 drive root ran `orca terminal send --terminal term_4137f7d4-… --text 'STOP THE ROLLBACK. …' --interrupt` against its own incident lane, dispatch `ctx_83a95c65e319` in Run `run_7715a23a5657`. The lane was mid-turn preparing a rollback the owner had just forbidden. `orca_send_ends_session` blocked the call with "interrupts or exits the agent in another terminal, which ends that session … leave interrupts and exits to the owner." Ordinary text would only have queued until the lane's turn ended. The owner asked for the hook to be fixed. Summary: `orca_send_ends_session` now allows `--interrupt` when the send names one literal `--terminal` and the caller is the main session whose `ORCA_TERMINAL_HANDLE` coordinates the Run of that terminal's dispatch. The guard finds the dispatch with `worker_of`, the `worker-list` scan the settled-close lift uses, and checks the coordinator with `coordinates()`, the same check the 12.88.15 `worker-stop` lift relies on. Exit text such as `exit`, `/quit`, `logout`, or a control byte stays blocked for everyone with the original message. An interrupt from a lane terminal, an in-process subagent, another Run's coordinator, or a session with no readable worker stays blocked, as does a handle or text named at run time. Motivation: An `--interrupt` stops the lane's current turn and delivers the text; it does not end the session. The root already owns the Run and may stop its lanes outright under cc-notes answer edfa70e. Making it wait for the owner to interrupt a lane is a round trip with no safety gained, and here it let a forbidden rollback keep running. Details: `interrupts_own_lane` reuses `lone_target` and `spelled` from the `worker-stop` lift; `own_lane` sits beside `own_dispatch` in `_sessions.py`. `orca_send_verdict` now takes the scan and event so it can probe. The blocked-interrupt message keeps the original first sentence and names the allowed route. `inline_worker` gained a `run` parameter for the other-Run test. The inline tests pin the 8:29 AM command verbatim, a send piped to `tail` followed by a `cci post`, as an Allow for the coordinating root, plus Blocks for no coordinator handle, a lane terminal, a subagent, another Run, no worker row, `--text exit --interrupt`, `/quit`, a `"$T"` handle, and `"$MSG"` text. Claude-Session-Id: 900424b6-7393-480c-a26a-f1bd21da6e57
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 8:29 AM on October 6, 2026, the release-v3 drive root ran
orca terminal send --terminal term_4137f7d4-… --text 'STOP THE ROLLBACK. …' --interruptagainst its own incident lane, dispatchctx_83a95c65e319in Runrun_7715a23a5657. The lane was mid-turn preparing a rollback the owner had just forbidden.orca_send_ends_sessionblocked the call with "interrupts or exits the agent in another terminal, which ends that session … leave interrupts and exits to the owner." Ordinary text would only have queued until the lane's turn ended. The owner asked for the hook to be fixed.Summary:
orca_send_ends_sessionnow allows--interruptwhen the send names one literal--terminaland the caller is the main session whoseORCA_TERMINAL_HANDLEcoordinates the Run of that terminal's dispatch. The guard finds the dispatch withworker_of, theworker-listscan the settled-close lift uses, and checks the coordinator withcoordinates(), the same check the 12.88.15worker-stoplift relies on. Exit text such asexit,/quit,logout, or a control byte stays blocked for everyone with the original message. An interrupt from a lane terminal, an in-process subagent, another Run's coordinator, or a session with no readable worker stays blocked, as does a handle or text named at run time.Motivation: An
--interruptstops the lane's current turn and delivers the text; it does not end the session. The root already owns the Run and may stop its lanes outright under cc-notes answer edfa70e. Making it wait for the owner to interrupt a lane is a round trip with no safety gained, and here it let a forbidden rollback keep running.Details:
interrupts_own_lanereuseslone_targetandspelledfrom theworker-stoplift;own_lanesits besideown_dispatchin_sessions.py.orca_send_verdictnow takes the scan and event so it can probe. The blocked-interrupt message keeps the original first sentence and names the allowed route.inline_workergained arunparameter for the other-Run test. The inline tests pin the 8:29 AM command verbatim, a send piped totailfollowed by acci post, as an Allow for the coordinating root, plus Blocks for no coordinator handle, a lane terminal, a subagent, another Run, no worker row,--text exit --interrupt,/quit, a"$T"handle, and"$MSG"text.