Repository navigation
fix: end a run stopped while the operator is asked - #494
Merged
Merged
Conversation
permitted() awaited the operator's answer with no way to stop, and abort() awaits the run, so a run stopped while a question went unanswered never ended. The loop now races the answer against the run's stop: a stop ends the wait and records the call as refused because the run stopped. Found by Sol reading loop.ts and by measuring stops at each point of a run.
Sequela02
force-pushed
the
fix/stop-permission-prompt
branch
from
October 18, 2026 15:40
fc66ab0 to
e7eec86
Compare
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.
Part 7 of the move to Effect became fixing the places in the engine's loop that do not hear a stop (debated with GPT-6 Astra and GPT-6.1 Sol, and measured; the owner approved fixing them directly rather than moving
loop.tsto Effect). This is the permission question.Defect
permitted()(packages/core/src/loop.ts) awaitedpermissions.ask(call, reason), which takes no signal, andabort()anddispose()await the run. Stopping a run while the operator was asked, and not answering, leftabort()waiting until someone answered. Measured: a session whoseasknever answers did not end 15 s after the stop.Reachable through the engine's API (a host that asks and is stopped), not through today's shell: there, Esc with the question open goes to the question and answers no, and a background session's waiting question is refused when it closes.
Change
untilStopped): a stop ends the wait, records the call as refused ("The run was stopped before the operator answered."), and reports it as stopped. The question itself is left to settle on its own;Permissions.askkeeps its signature, since no host has a stop to pass it today.operatorDecisionturns an answer into the decision and reason, which keepspermittedwithin the lint's complexity limit.Checks
packages/core/tests/permissions.test.ts: a question never answered, a stop, and the run ends aborted, the call not run, the refusal recorded. Ondevthe run never ends (the test times out); with the change it passes.bun run checklocally (Windows): root 264 passed; engine 332 passed, 3 skipped; lint and types clean. The budget fails on shell memory (122 MB, limit 115 MB) on this machine; CI measured 109.6 MB on refactor: run the gate's verification with Effect #487. CI decides.