Skip to content

Allow claude-review to actually post its comment/inline review - #92

Merged
d-morrison merged 1 commit into
mainfrom
claude/claude-review-allowed-tools
Aug 1, 2026
Merged

Allow claude-review to actually post its comment/inline review#92
d-morrison merged 1 commit into
mainfrom
claude/claude-review-allowed-tools

Conversation

@d-morrison

Copy link
Copy Markdown
Member

Summary

  • Follow-up to Restore pull-requests: write for claude-review #91. That PR fixed the GITHUB_TOKEN's API scope (pull-requests: write), but tested on PR #87 it turned out not to be the actual blocker — permission_denials_count stayed nonzero (and even grew, 8 → 17) and claude-review still posted zero comments on any same-repo PR.
  • Root cause is a different, separate layer: Claude Code's own tool-permission gate, independent of GITHUB_TOKEN's API scope. The code-review plugin posts its review via exactly two mechanisms (confirmed from the plugin's own command source):
    • gh pr comment (a Bash tool call), for the summary
    • mcp__github_inline_comment__create_inline_comment (an MCP tool), for inline comments
  • Neither is in Claude Code's default allowed-tools set for a non-interactive run, so every attempt to call them was silently auto-denied (no human present to approve the permission prompt) — that's exactly what permission_denials_count was counting. This matches the workflow file's own half-written hint that was sitting there as a dead comment: # claude_args: '--allowed-tools Bash(gh pr *)'.
  • Fix: set claude_args: '--allowed-tools "Bash(gh pr comment *)" "mcp__github_inline_comment__create_inline_comment"' so both mechanisms the plugin actually needs are explicitly allowed.

Test plan

  • Confirm a claude review comment (summary or inline) actually appears on a same-repo PR after this merges — would be the first genuine one ever recorded in this repo (see the historical review-comment audit in PR #91's discussion)
  • Confirm permission_denials_count drops to 0 (or near 0) in the run's result log

Generated by Claude Code

pull-requests: write (#91) fixed the GITHUB_TOKEN's API scope, but
that's not what was blocking posting: permission_denials_count stayed
high (and grew) because Claude Code's own tool-permission gate, which
is separate from the token's API scope, was denying every attempt to
call `gh pr comment` and mcp__github_inline_comment__create_inline_comment
- the two mechanisms the code-review plugin actually uses to post a
review. Neither is in Claude Code's default allowed-tools set for a
non-interactive run, so every attempt was silently denied with nobody
present to approve the prompt.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1-2-g6ad689f
Preview removed because the pull request was closed.
2026-08-01 04:48 UTC

@d-morrison
d-morrison merged commit 8924ce1 into main Aug 1, 2026
5 checks passed
@d-morrison
d-morrison deleted the claude/claude-review-allowed-tools branch August 1, 2026 04:47
d-morrison added a commit to imelainew/ucd-serg.github.io that referenced this pull request Aug 1, 2026
The code-review plugin gates all posting on a --comment argument:
"If --comment argument was NOT provided, stop here. Do not post any
GitHub comments." (step 7 of plugins/code-review/commands/code-review.md
in anthropics/claude-code.)

We have never passed it, so every review this repo has run has been
working as designed -- reviewing, printing to the job log, and posting
nothing behind a green check. claude has zero review comments across
UCD-SERG#78, UCD-SERG#79, UCD-SERG#80, UCD-SERG#86, UCD-SERG#87, UCD-SERG#92, UCD-SERG#93 and UCD-SERG#94.

This was not a permissions problem. UCD-SERG#91's pull-requests: write and
UCD-SERG#92/UCD-SERG#94's allowlist work were treating a symptom.

Closes UCD-SERG#96

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HMmB6db4xpbuqcqaQKArZb
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.

2 participants