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(hooks): don't say Blocked on PostToolUse additionalContext - #882
On Claude Code and OpenCode, a PostToolUse deny is sent as additionalContext. The tool has already run and the model has already seen its output, but the message said:
Blocked Bash by failproofai because: AWS access key ID detected in tool output, ...
Nothing was blocked. It now says:
Flagged Bash output by failproofai because: AWS access key ID detected in tool output, ...
Codex and Copilot keep "Blocked", since there the reason does replace the tool result.
Tests: updated the two unit tests and the e2e helper that check this text, and the 7 matching rows in unconfigured-golden.json. I diffed every evaluator and handler corpus case before and after the change: only the Claude and OpenCode PostToolUse deny outputs changed, and only in this text.
Actual redaction through updatedToolOutput (points 1 and 2 of #669) will be a separate PR.
Type of Change
Bug fix
New feature
Refactor
Documentation
Checklist
npm run lint passes
npx tsc --noEmit passes
npm run test:run passes for the affected files. I ran them on Windows: the only failures are path-related and fail on main in the same way.
npm run build succeeds. The Next.js build fails on Windows on main too, so I'm relying on CI for this one.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Generic PostToolUse denial context now says the tool output was flagged rather than claiming the call was blocked. The evaluator builds a shared reason-attribution phrase. Tests, fixtures, and the changelog use the updated wording.
Changes: PostToolUse wording
Layer / File(s)
Summary
Flagged-output message and coverage src/hooks/policy-evaluator.ts, __tests__/e2e/helpers/hook-runner.ts, __tests__/hooks/policy-evaluator.test.ts, __tests__/fixtures/two-tier/unconfigured-golden.json, CHANGELOG.md
The evaluator uses flagged-output wording for generic PostToolUse denials and selects a shared reason-attribution phrase. Assertions and fixture expectations change from “Blocked” to “Flagged.” The changelog records the update.
This changes the wording of the PostToolUse deny message so it no longer claims the call was blocked. No functional or operational risk was identified, so it is ready to merge.
Pre-merge checks · 4 · 1
Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (2 skipped: 2 …
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks (4 passed)
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Title check
The title clearly and concisely describes the main change: PostToolUse additionalContext no longer says "Blocked" when the tool output was already seen.
Description check
The description is complete and follows the repository template. It explains the change, identifies the bug-fix type, documents test results, and explains why the build checklist item remains unchecke…
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (2 skipped: 2 unsupported.)
Fix all pre-merge checks with AI
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit reads the tool output with care, “Flagged,” says the message, now clear and fair. The tests hop along to the wording anew, The changelog notes what the evaluator will do. Then the rabbit bounds off beneath the moonlight.
Comment @coderabbitai help to get the list of available commands.
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
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.
Description
Part of #669 (point 3).
On Claude Code and OpenCode, a PostToolUse deny is sent as
additionalContext. The tool has already run and the model has already seen its output, but the message said:Nothing was blocked. It now says:
Codex and Copilot keep "Blocked", since there the reason does replace the tool result.
Tests: updated the two unit tests and the e2e helper that check this text, and the 7 matching rows in
unconfigured-golden.json. I diffed every evaluator and handler corpus case before and after the change: only the Claude and OpenCode PostToolUse deny outputs changed, and only in this text.Actual redaction through
updatedToolOutput(points 1 and 2 of #669) will be a separate PR.Type of Change
Checklist
npm run lintpassesnpx tsc --noEmitpassesnpm run test:runpasses for the affected files. I ran them on Windows: the only failures are path-related and fail onmainin the same way.npm run buildsucceeds. The Next.js build fails on Windows onmaintoo, so I'm relying on CI for this one.