Skip to content

ci(claude): allow the inline-comment tool so the reviewer can post - #55

Merged
gonzafg2 merged 1 commit into
mainfrom
ci/claude-review-allow-inline-comments
Jun 11, 2026
Merged

gonzafg2 merged 1 commit into
mainfrom
ci/claude-review-allow-inline-comments

Conversation

@gonzafg2

@gonzafg2 gonzafg2 commented Jun 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes the claude-review workflow so the code-review plugin can actually post its findings, and uploads the execution transcript as a short-lived artifact so future posting failures are diagnosable.

Motivation

Every claude-review run since #54 has ended green while posting nothing. All four runs of 2026-06-11 (PRs #46, #47, #49, #50) show the same signature in their logs: success, between 4 and 53 permission_denials_count, and No buffered inline comments from the posting step — zero reviews or comments reached any PR. A green check that silently drops every finding is worse than no check.

Root cause (verified in the action's source): in agent mode (explicit prompt:), claude-code-action only mounts the github_inline_comment MCP server when that tool is named in the action-level allowed tools — src/mcp/install-mcp-server.ts gates on hasInlineCommentTools computed from the action's allowedTools, not from the plugin's command frontmatter. The code-review plugin's allowed-tools: frontmatter requests mcp__github_inline_comment__create_inline_comment, but the action never consults it when deciding which MCP servers to start. Result: the server is never mounted, every posting attempt by the review skill is denied, the /tmp/inline-comments-buffer.jsonl buffer stays empty, and the posting step finds nothing to publish.

The fix

  1. Pass --allowedTools "mcp__github_inline_comment__create_inline_comment" in claude_args — the exact form the action repo's own dogfooding workflow (.github/workflows/claude-review.yml in anthropics/claude-code-action) uses for this same purpose.
  2. Add an Upload execution transcript step (if: always(), 7-day retention) using the action's execution_file output, so the next time the reviewer misbehaves we can read what it actually did instead of inferring from num_turns and denial counts.

Verification

The fix cannot be exercised from this PR, by design. The claude-review check on this PR fails (run 27358514428) in the OIDC→app-token exchange with: "Workflow validation failed. The workflow file must exist and have identical content to the version on the repository's default branch" — an anti-tampering guard that rejects any run whose workflow file differs from main's, precisely the situation of a PR that edits that workflow. The error message itself says this is normal and to be ignored. claude-review is not a required check; the required ones (builds, cargo deny) are green here.

What was verified instead:

Type of change

  • CI only

Checklist

  • Commits signed off under the DCO (git commit -s).
  • Conventional Commits.

Security considerations

No new attack surface: the added flag is static (no untrusted interpolation), and the artifact step's path comes from the action's own output, not from event data. The transcript artifact can contain PR content the reviewer read — all of it already public in this repository — and expires in 7 days.

In agent mode (explicit prompt) claude-code-action only mounts the
github_inline_comment MCP server when the tool is named in the
action-level allowed tools (install-mcp-server.ts gates on
hasInlineCommentTools); the code-review plugin's own frontmatter cannot
grant it. Every run since #54 ended 'success' with 4-53 permission
denials, 'No buffered inline comments', and nothing posted on PRs
46/47/49/50.

Pass --allowedTools "mcp__github_inline_comment__create_inline_comment"
in claude_args — the same form the action repo's own
.github/workflows/claude-review.yml uses — and upload the execution
transcript as a short-lived artifact so the next posting failure is
diagnosable instead of silent.

Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2
gonzafg2 merged commit 1c1e37a into main Jun 11, 2026
6 of 7 checks passed
gonzafg2 added a commit that referenced this pull request Jun 11, 2026
…gs (#56)

The plugin's command is explicit (step 7): 'If --comment argument was
NOT provided, stop here. Do not post any GitHub comments.' Our prompt
never passed it, so every review ran to completion and printed its
findings only to the job log — confirmed by the PR #46 run transcript
(run 27358953209), which ends with 'No --comment flag provided — no
GitHub comments posted' right after compiling four findings.

Companion to #55: that PR mounted the github_inline_comment MCP server
the posting step needs; this one flips the plugin's own posting switch.

Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2
gonzafg2 deleted the ci/claude-review-allow-inline-comments branch July 18, 2026 04:15
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.

1 participant