fix: scope the autonomous-loop guard to one owner session (#128) - #135
Merged
Conversation
loop_guard.json was machine-global: arming one /loop session's guard made the Stop hook refuse stops for every OTHER concurrent session, and any session's PostToolUse zeroed the shared no-work backstop counter. The armed state now records an owner session (from `omind loop arm --session` / $CLAUDE_SESSION_ID, or claimed by the first session to hit a Stop); a different session is never refused and its work never resets the owner's counter. Closes #128. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| if sess is not None: | ||
| if owner is None: | ||
| # First session to hit a Stop under a global arm claims the loop. | ||
| owner = sess |
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.
Closes #128.
loop_guard.jsonwas machine-global, so arming one/loopsession's guard made the Stop hook refuse stops for every other concurrent session on the machine (up to the 24h expiry), and any session'sPostToolUsezeroed the shared no-work backstop counter.The armed state now records an owner session — from
omind loop arm --session/$CLAUDE_SESSION_ID, or claimed by the first session to hit a Stop. A different, concurrent session is never refused, and its work never resets the owner's counter. Backward compatible (a plainomind loop armstill works; it's just owned by the first stopping session instead of trapping all of them).Test plan
🤖 Generated with Claude Code
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/