Repository navigation
fix(core): stop unstarted tools after batch cancellation - #40
Conversation
|
Thanks @adity982 for the focused cancellation fix and regression tests! Reviewed Live Motif model testing is currently unavailable because the Infron endpoint is unavailable to us. This review did not make live model calls. The changed tool-batch cancellation, event/checkpoint consistency, resume protection, and exit-reason behavior can be verified independently with scripted model responses and the real runLoop/ToolExecutor, so I have decided to merge based on that evidence. Independent checks covered cancellation during an actually running bash, before/at/after tool dispatch, multiple skipped writes, checkpoint/resume consistency, and cancellation after the final call. All nine passed. The executor's initial side-effect guard already came from #37; this PR fixes the remaining loop-level starts/intents, repair, and termination behavior. No extra tool starts or mutation intents were emitted for skipped calls, and uncertain-operation resume protection remained intact. Frozen install, typecheck, build, and tool-schema lint passed. The original branch's single insights fixture failure was the unrelated mtime bug already fixed by #39; applying this exact patch to current main passed all 1,643 tests. All five PR CI jobs passed: https://github.com/TaewoooPark/Motifcode/actions/runs/37100770804 . The Python job retains five optional GPU-only skips; this is not live-model or GPU inference validation. No blocking defect or required implementation change found. Keeping the running-bash and final-call cancellation cases as additional committed regressions would be a useful non-blocking follow-up. I am marking the reviewed draft ready and merging as a squash commit after the preceding main checks complete. Main integration is separate from npm publication; no release is being published here. |
Cancelling a tool batch now stops before starting the remaining calls, and records explicit not-executed observations for them. This keeps the transcript and final checkpoint complete without emitting tool execution events or durable mutation intent for skipped work. Cancellation after the last call also ends immediately, before repair or loop-detection handling.
Fixes #17.
The offline regressions exercise the real loop and CLI executor: cancellation at tool start and tool completion, normal uninterrupted execution, and an already-aborted direct write. They check the marker file, event order, model request count, and checkpoint state. The executor's existing early cancellation guard is preserved.
Validation:
AI assistance: OpenAI Codex (GPT-6).