Fix PR Review Assistant not being able to push the review comment#2604
Conversation
The system prompt instructs the model to write the review to `review.md` before posting it via `gh pr comment --body-file`, but `Write` was not in `allowed_tools`, so every file-creation attempt was denied. Sonnet 4 coincidentally pivoted to an inline `--body` fallback; Opus 4.6 kept retrying file-write variants and exhausted `max_turns` before falling back, so no review was posted. This is safe: the job runs on the trusted base ref (never the PR head), `permissions: contents: read` prevents any repo/push writes, and the runner filesystem is ephemeral — `Write` only lets the model create scratch files like `review.md` inside the throwaway runner.
Automated PR Review (Claude)0. SummaryVerdict: This PR adds 1. Correctness & Implementation BugsNo findings. 2. AGENTS.md AdherenceNo findings. This is a CI-only change with no TypeScript/Vue code, no new dependencies, and no changes to 3. Security3.1 Obfuscated or intentionally unreadable code. — No findings. 3.2 Suspicious base64/hex/long-encoded blobs. — No findings. 3.3 Hidden Unicode, zero-width characters, homoglyph attacks. — No findings. 3.4 Unexpected network calls or exfiltration patterns. — No findings. 3.5 Changes to CI workflows that could execute arbitrary code or weaken sandboxing. (
Given these mitigations, the risk is negligible. The 3.6 Secret handling. — No new secrets, tokens, or credentials introduced. No weakened CORS/CSP. No 3.7 New dependencies. — No new dependencies added. 3.8 Other suspicious patterns. — No findings. 4. PerformanceNo findings. 5. UI / UXNo findings. This is a CI-only change with no user-facing impact. 6. Code Quality & StyleNo findings. The single-line addition follows the existing comma-separated format of the 7. TestsNo findings. CI workflow configuration changes are not typically unit-tested; the workflow itself serves as its own integration test. 8. DocumentationNo findings. The PR body adequately explains the rationale and security considerations. 9. Nitpicks / OptionalNo findings. Generated by Claude. This is advisory; a human reviewer must still approve. |
As can be seen on #2603, the PR Review Assistant action is running correctly, but is failing to push the comment to Github. This PR fixes that.
The system prompt instructs the model to write the review to
review.mdbefore posting it viagh pr comment --body-file, butWritewas not inallowed_tools, so every file-creation attempt was denied. Sonnet 4 coincidentally pivoted to an inline--bodyfallback; Opus 4.6 kept retrying file-write variants and exhaustedmax_turnsbefore falling back, so no review was posted.This is safe: the job runs on the trusted base ref (never the PR head),
permissions: contents: readprevents any repo/push writes, and the runner filesystem is ephemeral —Writeonly lets the model create scratch files likereview.mdinside the throwaway runner.