Skip to content

fix: guard hook re-reads transcript for a lane stated in the same message (0.6.1) - #9

Merged
sofus-common merged 1 commit into
mainfrom
fix/lane-guard-race
Oct 15, 2026
Merged

sofus-common merged 1 commit into
mainfrom
fix/lane-guard-race

Conversation

@sofus-common

Copy link
Copy Markdown
Contributor

Summary

  • Fix: when the lane statement and the tool call are in one assistant message, the statement can reach the transcript after the PreToolUse hook reads it, so the first write is denied. When no lane is found, hooks/edit_guard.py now re-reads the transcript every 0.1 s for up to 2 s before denying.
  • Dates 0.6.1 (with fix: guard hook recognizes lane stated via SendUserMessage or "Lane is X" (0.6.1) #8) and records the verification.

Verification

  • Headless Claude Code 2.1.300 with claude-sonnet-5-5, typo fixture, agent states "The lane is Fast." then edits:
  • New test_edit_guard.py case (statement appended 0.3 s after the hook starts) fails on the fix: guard hook recognizes lane stated via SendUserMessage or "Lane is X" (0.6.1) #8 hook and passes now.
  • check_version.py (+ self-test), test_behavior_check.py, test_edit_guard.py pass.
  • Not run: the 12-case behavior suite (hook-only release; docs/behavior-checks.md requires it for skill-instruction changes). Brief mode is unavailable headless, so the SendUserMessage path is unit-tested only.

Known limits

  • A write with no stated lane is now denied after a 2 s wait instead of at once.

🤖 Generated with Claude Code

…sage (0.6.1)

A lane statement in the same assistant message as the tool call could
reach the transcript after PreToolUse read it, so the first write was
denied. When no lane is found, re-read every 0.1 s for up to 2 s.
Dates 0.6.1 with the headless Claude Code replay results.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sofus-common
sofus-common merged commit 959a3e0 into main Oct 15, 2026
2 checks passed
@sofus-common
sofus-common deleted the fix/lane-guard-race branch October 15, 2026 15:17
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.

1 participant