Fix operator session recovery: timeout, attempt persistence, interrupt logging#12
Open
Fix operator session recovery: timeout, attempt persistence, interrupt logging#12
Conversation
…t logging - Add stage_timeout (default 4h) with threading.Timer to prevent infinite hangs - Fix _looks_like_resume_failure operator precedence bug (and/or without parens) - Log KeyboardInterrupt events to logs_raw with elapsed time - Persist attempt_no across resumes via operator_state/<stage>.attempt_count.txt - Add --stage-timeout CLI parameter - Add .gitignore entries for docs/ and examples/ - 13 new tests covering all fixes Addresses TODO 3 (V3-1 through V3-4) from vulnerability analysis. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
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.
Summary
_looks_like_resume_failureoperator precedence bug (and/orwithout parens)stage_timeout(default 4h) withthreading.Timerto prevent infinite hangsattempt_noacross resumes viaoperator_state/<stage>.attempt_count.txtKeyboardInterruptevents tologs_rawwith elapsed time--stage-timeoutCLI parameterContext
Example run
20260330_101222showed Stage 05 entering a 7+ resume loop spanning two days. Root causes: no timeout, attempt counter reset on resume, and a logic bug in resume failure detection.Test plan
tests/test_operator_recovery.py— all passing--fake-operatorrun → abort → resume → verify attempt_no continues🤖 Generated with Claude Code