From 47f407a039747a48cb372f4d38f8b3c8c3bd87ee Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Sat, 25 Jul 2026 12:11:11 -0400 Subject: [PATCH] Give the PR reviewer the tools it needs, and more turns 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 --- .github/workflows/claude-code-review.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index d73366c..1aaec8e 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -91,9 +91,14 @@ jobs: `confirmed: true`) to flag specific lines. Only post GitHub comments - do not return review text as a message. + # --allowedTools REPLACES the default tool set rather than adding to it. + # Without Read/Grep/Glob the reviewer cannot open a single file in the + # checked-out branch, which is exactly what the prompt above asks it to + # do. PR #399 burned all 20 turns on denied calls + # (permission_denials_count was 10) and failed without posting anything. claude_args: | - --max-turns 20 - --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" + --max-turns 40 + --allowedTools "Read,Grep,Glob,mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(git diff:*),Bash(git log:*)" # Fork PRs: GitHub withholds repository secrets from `pull_request` runs on # forks and issues a read-only GITHUB_TOKEN, so this workflow cannot review