Skip to content

fix: run no tool once the run is stopped during its start handlers - #495

Merged
Sequela02 merged 1 commit into
devfrom
fix/stop-after-tool-start
Oct 18, 2026
Merged

Sequela02 merged 1 commit into
devfrom
fix/stop-after-tool-start

Conversation

@Sequela02

Copy link
Copy Markdown
Contributor

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.ts to Effect). This is the tool that started after a stop. Implemented by Sol (gpt-6.1-sol), who found it reading loop.ts; reproduced and checked by Claude.

Defect

runCall (packages/core/src/loop.ts) checked for a stop before awaiting the tool_execution_start handlers and not after. A stop that came while a handler ran still let the tool execute. Reproduced on dev: a handler held during the stop, then released; the run ended aborted, and the write call's file was written after the stop.

Change

One line: after the start handlers return, a stopped run reports the call as stopped (stoppedCall), as it does when the stop came before. Its intent and result are recorded as before.

Checks

  • New test in packages/core/tests/conformance.test.ts: a start handler held during the stop; the run ends aborted, the file is not written, and the call's result is an error. It fails on dev (the file exists) and passes with the change; checked by Sol and again by Claude.
  • bun run check (Sol, Windows): root 264 passed; engine 332 passed, 3 skipped; types and lint clean. The budget failed on shell memory on this machine (123.6 MB, limit 115 MB); CI decides.

The loop checked for a stop before the tool_execution_start handlers and not after, so a stop that came while a handler ran still let the tool execute: a write landed after the stop. It now checks again and reports the call as stopped. Implemented by Sol (gpt-6.1-sol), who found it reading loop.ts; reproduced and checked by Claude.
@Sequela02
Sequela02 merged commit 6bc1489 into dev Oct 18, 2026
9 checks passed
@Sequela02
Sequela02 deleted the fix/stop-after-tool-start branch October 18, 2026 15:40
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