Skip to content

fix: scope the autonomous-loop guard to one owner session (#128) - #135

Merged
CryptoJones merged 1 commit into
mainfrom
fix/128-loopguard-session-scope
Jul 1, 2026
Merged

fix: scope the autonomous-loop guard to one owner session (#128)#135
CryptoJones merged 1 commit into
mainfrom
fix/128-loopguard-session-scope

Conversation

@CryptoJones

Copy link
Copy Markdown
Owner

Closes #128.

loop_guard.json was machine-global, so arming one /loop session's guard made the Stop hook refuse stops for every other concurrent session on the machine (up to the 24h expiry), 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, concurrent session is never refused, and its work never resets the owner's counter. Backward compatible (a plain omind loop arm still works; it's just owned by the first stopping session instead of trapping all of them).

Test plan

  • New tests: owner refused but concurrent session not; global arm claimed by first stop; concurrent work doesn't reset the owner's counter.
  • Full suite: 717 passed, 1 skipped. ruff + mypy clean.

🤖 Generated with Claude Code

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

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>
@CryptoJones
CryptoJones merged commit 530d2a5 into main Jul 1, 2026
10 checks passed
@CryptoJones
CryptoJones deleted the fix/128-loopguard-session-scope branch July 1, 2026 23:07
Comment thread src/omind/loopguard.py
if sess is not None:
if owner is None:
# First session to hit a Stop under a global arm claims the loop.
owner = sess
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.

loopguard: scope the autonomous-loop guard per session

2 participants