Repository navigation
fix: refuse a prompt stopped while it waits to start - #497
Merged
Merged
Conversation
A prompt waits for the session's startup and for a manual compaction before it owns a controller, and abort() only stopped what was already running, so a prompt stopped while it waited later ran with a fresh controller. It is now admitted, and stoppable, before its first wait, and refused when stopped; its admission becomes the run's controller. Print mode takes that refusal as the operator's stop rather than an error. Implemented by Sol (gpt-6.1-sol), who found it reading loop.ts; reproduced and checked by Claude, who added the print-mode case.
With a prompt stopped before it starts now refused, print mode would print that refusal with its stack after a Ctrl+C or a termination. It ends without a run and exits 1, as a stop does.
Sequela02
force-pushed
the
fix/stop-waiting-prompt
branch
from
October 18, 2026 19:15
40b579e to
9612a1a
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 a prompt stopped while it waits to start. Implemented by Sol (gpt-6.1-sol), who found it readingloop.ts; reproduced and checked by Claude, who added the print-mode case.Defect
prompt()(packages/core/src/loop.ts) waits for the session's startup (session_starthandlers) and for a manual compaction before it owns a controller;abort()stopped only what was already running. A prompt stopped while it waited then started with a fresh controller and ran. Reproduced ondev: asession_starthandler held, a prompt sent,abort()awaited, the handler released; the run endedcompletedand its tool wrote its file.Change
admitting);abort()anddispose()stop waiting admissions, and the prompt rechecks after each wait. A stopped prompt is refused: it rejects with the stop's reason before recording a request, so no run is added and the previous run's outcome stays. When it runs, its admission becomes the run's controller.print.ts) takes that refusal, after the operator's Ctrl+C or a termination, as the stop rather than an error: it ends "without a run" and exits 1, as a stop does, instead of printing the rejection with its stack. The shell already shows a rejected prompt's reason as a note.Checks
packages/core/tests/stop-admission.test.ts: a prompt stopped while waiting for startup, and one stopped while waiting for a manual compaction, run nothing, and a prompt after the stop runs. Both fail ondev(the stopped prompt's tool wrote its file) and pass with the change; checked by Sol and again by Claude.compaction-session,conformanceandreceipt-commandtests: all pass.bun run check(Sol, Windows): root 264 passed; engine 333 passed, 3 skipped; types and lint clean. The budget failed on shell memory on this machine (120.4 MB, limit 115 MB); CI decides.Not covered by a test: the print-mode case (a stop by signal before the request starts).