Fix PR reviewer: it was denied the tools needed to read code - #401
Merged
Conversation
First live run of the review workflow failed on PR #399: permission_denials_count: 10 ##[error]Execution failed: Reached maximum number of turns (20) --allowedTools REPLACES the default tool set rather than adding to it, so the resolved list was exactly the four entries I passed - no Read, Grep, or Glob. The prompt tells the reviewer "the PR branch is already checked out in the working directory", then denied it every tool needed to open a file. It spent its turns on denied calls and hit the cap without posting a review. PR #400 passed only because its diff is two small files, so it fit. Adds Read/Grep/Glob plus read-only git diff/log, and raises the cap to 40 turns since a real review needs to read several files. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes the PR review workflow, which failed on its first real run.
What happened
The workflows went live with v1.17.0 (they need to be on the default branch). The first substantive PR they saw was #399, and the review failed:
Root cause
--allowedToolsreplaces the default tool set rather than adding to it. The resolved list in the run log was exactly the four entries I passed:No
Read, noGrep, noGlob. So the prompt told the reviewer "the PR branch is already checked out in the working directory" and then denied it every tool needed to open a file. It spent its turns getting denied, hit the 20-turn cap, and posted nothing.PR #400 passed only because its diff is two small files that fit inside the budget. That is why this looked like it worked.
Fix
Read,Grep,Glob, plus read-onlygit diff/git log--max-turnsfrom 20 to 40, since a real review reads several filesCost reference: the failed 20-turn run was $0.63, so a completed review should land in the low single digits of dollars.
Test plan
claude_argsresolves to the intended flagsclaude-code-review.yml, so the action's default-branch content check skips it (expected, documented in the file). The real test is the first PR opened after this reachesmain.🤖 Generated with Claude Code