Repository navigation
fix(run-agent,pr-review,deps-verify): allow the agent to write its report files outside the checkout by exact path - #218
Merged
Conversation
azlekov
force-pushed
the
fix/pr-review-runner-temp-writes
branch
2 times, most recently
from
October 27, 2026 11:48
4cdce14 to
52fdcb0
Compare
…port files outside the checkout by exact path Claude Code refuses a Write call or a shell redirect to a path outside its working directories unless an Edit allow rule names it, and RUNNER_TEMP is outside the checkout on every runner. pr-review's allowlist has no Write, so a run got its verdict files only when the agent happened to write them a way Claude Code does not inspect. run-agent now turns report-file and a new write-files input into one Edit(//path) rule per file, and names refused tool calls (tool and file only) in its warning and in the fallback report's why. pr-review passes review-body.md through write-files. Closes #216 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
azlekov
force-pushed
the
fix/pr-review-runner-temp-writes
branch
from
October 27, 2026 11:48
52fdcb0 to
adc31ac
Compare
|
🎉 This PR is included in version 1.44.7 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Closes #216.
Cause
This is a permission rule problem in this repo, not a runner or slot problem. Claude Code refuses a Write call, and a Bash
> fileredirect, to any path outside its working directories unless anEditallow rule names that path. A headless run cannot ask, so it refuses. The checkout is the only working directory, andRUNNER_TEMPis outside it on every runner, hosted and self-hosted. pr-review's allowlist isBash "Bash(gh:*)" Read Grep Globplus the inline-comment tool, with no Write and no Edit rule. A run got its two files only when the agent happened to write them in a way Claude Code does not inspect.Evidence from 34 pr-review runs across the org on 2026-10-27, all on the same Claude Code version, model and tool list:
permission_denials_count: 2, and each agent says its two writes under_temp/were refused.deps-verify, issue-implement and pr-iterate do not hit this, because they allow bare
WriteandEdit.Fix
report-fileand a newwrite-filesinput into oneEdit(//abs/path)rule each, added to--allowed-tools. That allows exactly those files, through Write or a redirect, whereverRUNNER_TEMPis. A path holding a glob or pattern character, a.or..segment, or anything that would split the tool list is refused, and the step fails.--add-dironRUNNER_TEMPwas rejected on purpose, because the agent's settings file and its secrets live there.review-body.mdaswrite-files.review-verdict.jsonis already itsreport-file.why. A missing verdict now saysClaude Code refused: Write …/review-verdict.jsoninstead of a bare "without writing a valid review-verdict.json". It never logs content or command text.Tests
actions/run-agent/test.sh: the writable step with a self-hosted slotRUNNER_TEMPoutside the workspace and with a hosted one. The tests check the exact rules, that the rules split into their own tool-list entries, and that unsafe paths are refused. They also check that denials are named without content, and that the fallbackwhyincludes them. 94 pass.report-fileorwrite-files. A mutation check confirmed it fails whenwrite-filesis dropped.Not verified
I could not test a live headless run of the
Edit(//path)rule here. The local CLI's sign-in had expired. The behaviour follows Claude Code's permission docs://anchors at the filesystem root, andEditrules cover Write and output redirects. The first pr-review run on a self-hosted slot after release is the real check. It should reportpermission_denials_count: 0and write both files.🤖 Generated with Claude Code
Also: deps-verify's agent writes
deps-bumps.jsonanddeps-verdict.mdin RUNNER_TEMP besides its report file, so its run-agent call now lists both inwrite-files. Thewritablestep runs only when there is a file to allow.