Repository navigation
Re-confirm a proof writer's stop after close cancels pending work - #61
Merged
Merged
Conversation
stopProofWriter asked stopForFreeze once. When an interrupted turn left a host callback pending, the answer was turn-not-settled; the function then closed the session, which cancels the callback and stops the process, but threw math_writer_stop_unconfirmed anyway and failed the whole run. A balance-7 research run hit this: the Lead's native followup_task to an idle member blocked while the host prepared that member's workspace, the soft-slice wait-limit interrupted the Lead turn, and the still-pending followup callback made the freeze unconfirmed. stopProofWriter now persists the quarantine first as before, closes, and asks stopForFreeze again. If the writer is confirmed stopped it clears the quarantine and emits proof_ready_freeze_confirmed / team_writer_stop_confirmed; otherwise, or if close fails, it keeps the quarantine and throws as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
stopProofWriternow asksstopForFreezea second time afterclose(). Before this change it asked only once, before closing.Failure
A balance-7 research run ended in
runtime_errorwithmath_writer_stop_unconfirmed:solver:turn-not-settled:followup_taskon an idle member. The host blocks that call until the member's workspace is prepared, which took about 5 minutes.NativeAgentControl, sostopForFreezereturnedturn-not-settled.stopProofWriterthen closed the session. Closing cancelled the callback and stopped the process, but the function threw anyway and the whole run failed.Change
close().stopForFreezeis called again. If the writer is confirmed stopped, the quarantine is cleared,proof_ready_freeze_confirmed(Lead) orteam_writer_stop_confirmed(member) is emitted, and the normal checkpoint path continues.close()fails, the quarantine is kept and the error is thrown as before.Tests
tests/proofWriter.test.ts(5 cases), plus one case intests/codexSessionAgentControl.test.tsthat drives the real Codex session fixture with a pending host callback.typecheckandbun run buildpass.Not changed
followup_taskon an idle member still blocks the Lead's tool call while the member's workspace is prepared. With this fix that wait no longer fails the run.🤖 Generated with Claude Code