You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(guardrails): check-bash-file-changes swallows unexpected errors with no "guard did not run" notice #6905
plugins/guardrails/README.md:302 says "Every hook says so when it could not run": every registered hook installs the shared abort boundary and turns an unexpected exit into a one-line "guard did not run" notice. plugins/guardrails/hooks/check-bash-file-changes.mjs is registered on three hook events (hooks.json:86,205,222) but is a Node module, not a shell hook, so it never installs abort-boundary.sh. Its entry point ends with if (invokedDirectly()) main().catch(() => {}); (line 520), so any exception main() does not handle itself exits 0 with no output.
The hook already reports its known skips as notes ("not examined: ..."); only unexpected failures are silent. When one happens, the shell-write check did not run and nobody is told, which is the case the abort boundary exists to prevent.
Found by a Codex review on #6852, which cites this README claim.
Fix
Make the catch report the same way the abort boundary does: write a one-line "guardrails: check-bash-file-changes did not run: " notice on stderr and as a systemMessage, then exit with the hook's declared posture (fail-open). Alternatively, narrow the README claim to the shell hooks and name the Node hook's behavior. The first removes the gap; the second only documents it.
Verification
A test that makes main() throw (for example, an unwritable CLAUDE_PLUGIN_DATA) and asserts the notice appears and the exit status matches the declared posture. Per the hook-precision convention, include a stay-quiet test that a normal run emits nothing new.
Thanks for the detailed report. I confirmed plugins/guardrails/hooks/check-bash-file-changes.mjs ends with main().catch(() => {});, so an unexpected exception inside main() exits 0 with no stderr or systemMessage output — the one case the shared abort boundary exists to cover, but this Node hook never installs it. The known-skip paths (missing snapshot, oversized git status, etc.) already report as notes; only the unhandled-exception path is silent, as described.
Both fix directions you outlined (report a "did not run" notice at the hook's declared fail-open posture, or narrow the README claim) sound reasonable; which to take is a maintainer call. #6674 and the closed #6709 are related prior work on this same hook but don't cover this specific gap, so this doesn't look like a duplicate.
Activity
docs(upstream): qualify guardrails coverage and drop remaining paraph…
github-actions commentedon Oct 11, 2026
Thanks for the detailed report. I confirmed
plugins/guardrails/hooks/check-bash-file-changes.mjsends withmain().catch(() => {});, so an unexpected exception insidemain()exits 0 with no stderr orsystemMessageoutput — the one case the shared abort boundary exists to cover, but this Node hook never installs it. The known-skip paths (missing snapshot, oversized git status, etc.) already report as notes; only the unhandled-exception path is silent, as described.Both fix directions you outlined (report a "did not run" notice at the hook's declared fail-open posture, or narrow the README claim) sound reasonable; which to take is a maintainer call. #6674 and the closed #6709 are related prior work on this same hook but don't cover this specific gap, so this doesn't look like a duplicate.
Automated triage. A maintainer reviews it.
docs(upstream): finish removing upstream descriptions from the Jev re…
docs(upstream): add the #6905 recheck trigger and drop the model-size…
fix(guardrails): report the did-not-run notice from the hook's catch