Summary
The AI review pipeline's "review" job (running the reviewer agent via claude-code-action) sometimes completes with is_error: false — the agent itself reports success — without ever writing the required review-metrics.yaml/.json file at REVIEW_METRICS_PATH. The downstream script agent-repo/.github/scripts/review-receiver/read-metrics-and-compute-conclusion.sh then fails with:
##[error]No metrics file at ... — review agent did not complete.
This cascades to a LouisBrunner/checks-action step reporting conclusion: failure, title: "The review agent failed to run" on the original check run in the consumer repo, plus a generic ::error::Receiver pipeline failed. line. The accompanying troubleshooting hint about REVIEW_GITHUB_APP_ID/REVIEW_GITHUB_APP_PRIVATE_KEY does not apply — auth is confirmed present in all three occurrences below.
Evidence
Occurrence 1 — nsheaps/agents#333 (check run 93983045453, job 93983057990, run 31554184270)
- Agent JSON result:
is_error: false, num_turns: 49, total_cost_usd: 2.0171772499999996, permission_denials_count: 16
- No metrics file was ever written despite the agent reporting success.
Occurrence 2 — nsheaps/.ai-agent-jack#483 (check run 93984292623, HeadSHA f40ef82e86547f0b67b93c6d7b8820e26f7f4b3f, run 31554600489)
- Same symptom, on the SAME HeadSHA that an EARLIER run successfully completed a full review (Henry's COMMENT-verdict review is posted on this PR). This confirms the failure is intermittent, not something that blocks review outright — a re-run on identical input can succeed or fail.
Occurrence 3 — nsheaps/ai-mktpl#743 (check run 93983718763, HeadSHA 68e8e530a50fec9478c2d3ce699d38bb809a8c71, run 31554405041)
- Same symptom, different repo entirely.
Three independent occurrences across three different repos, with successful runs interspersed on at least one of the same commits — this points to a systemic/intermittent reliability bug in the shared review pipeline (claude-code-action and/or the metrics-handling script), not something caused by the content of any specific PR.
Candidate root cause (not fully confirmed)
The review prompt template embedded in the job log (step 11, "Emit review metrics") explicitly instructs the agent to use the Write tool at /home/runner/work/_temp/review-metrics.yaml, and explicitly warns:
[do NOT use] Bash(gh:*)/Bash(git:*) — allowlist and will be silently denied, leaving this step incomplete even though the rest of the review su[cceeded]...
This suggests that on failing runs, the agent may attempt to write/commit the metrics file via a gh/git-based path instead of the required Write tool, gets silently denied (a plausible source of some of the 16 permission_denials_count seen on occurrence 1), completes the rest of the review successfully, but never actually creates the gating file. This is grounded in log evidence but NOT confirmed via a full turn-by-turn transcript — the specific denied tool call hasn't been isolated.
Suggested investigation checklist
Impact
Blocks the CI-green gate for PRs relying on request-review label re-triggering — three in-flight PRs (nsheaps/agents#333, nsheaps/.ai-agent-jack#483, nsheaps/ai-mktpl#743) hit this and required re-triggering the review.
Summary
The AI review pipeline's "review" job (running the reviewer agent via
claude-code-action) sometimes completes withis_error: false— the agent itself reports success — without ever writing the requiredreview-metrics.yaml/.jsonfile atREVIEW_METRICS_PATH. The downstream scriptagent-repo/.github/scripts/review-receiver/read-metrics-and-compute-conclusion.shthen fails with:This cascades to a
LouisBrunner/checks-actionstep reportingconclusion: failure,title: "The review agent failed to run"on the original check run in the consumer repo, plus a generic::error::Receiver pipeline failed.line. The accompanying troubleshooting hint aboutREVIEW_GITHUB_APP_ID/REVIEW_GITHUB_APP_PRIVATE_KEYdoes not apply — auth is confirmed present in all three occurrences below.Evidence
Occurrence 1 —
nsheaps/agents#333(check run 93983045453, job 93983057990, run 31554184270)is_error: false, num_turns: 49, total_cost_usd: 2.0171772499999996, permission_denials_count: 16Occurrence 2 —
nsheaps/.ai-agent-jack#483(check run 93984292623, HeadSHAf40ef82e86547f0b67b93c6d7b8820e26f7f4b3f, run 31554600489)Occurrence 3 —
nsheaps/ai-mktpl#743(check run 93983718763, HeadSHA68e8e530a50fec9478c2d3ce699d38bb809a8c71, run 31554405041)Three independent occurrences across three different repos, with successful runs interspersed on at least one of the same commits — this points to a systemic/intermittent reliability bug in the shared review pipeline (
claude-code-actionand/or the metrics-handling script), not something caused by the content of any specific PR.Candidate root cause (not fully confirmed)
The review prompt template embedded in the job log (step 11, "Emit review metrics") explicitly instructs the agent to use the
Writetool at/home/runner/work/_temp/review-metrics.yaml, and explicitly warns:This suggests that on failing runs, the agent may attempt to write/commit the metrics file via a
gh/git-based path instead of the requiredWritetool, gets silently denied (a plausible source of some of the 16permission_denials_countseen on occurrence 1), completes the rest of the review successfully, but never actually creates the gating file. This is grounded in log evidence but NOT confirmed via a full turn-by-turn transcript — the specific denied tool call hasn't been isolated.Suggested investigation checklist
gh/gitbeing denied is itself a signal the template should be hardened (e.g. retry logic, or a repo-side fallback check for the metrics file via a non-agent step)num_turns: 49— does the agent "forget" the metrics step on longer reviews?)is_error: falsebut no metrics file exists, treat it as a distinct, more specific failure mode (e.g. "review completed but metrics step skipped") rather than the generic "review agent did not complete" — this would make the failure mode easier to diagnose from the check-run title aloneclaude-code-action's permission allowlist should explicitly grantWriteto the metrics path (it should already, per the prompt template, but confirm the actual allowlist config) to rule out a race/config driftImpact
Blocks the CI-green gate for PRs relying on
request-reviewlabel re-triggering — three in-flight PRs (nsheaps/agents#333,nsheaps/.ai-agent-jack#483,nsheaps/ai-mktpl#743) hit this and required re-triggering the review.