Repository navigation
PR Review Agent — failures detected 2026-06-04 #428
Description
1. Executive Summary
Status: DEGRADED
Period: 2026-06-04T01:00:00Z – 2026-06-04T05:01:28Z
Result: 3 of 100 runs failed (3%) — all failures share a single root cause
Key findings:
DON_PETRY_BOT_GH_PATlacked thereposcope during a burst of runs against PR PR Review Agent: make failure runs diagnosable and harden transient setup failures #353 (01:21–02:05 UTC); subsequent runs on the same PR succeeded, suggesting a temporary token state or rotation- 25 cancellations are expected and benign —
cancel-in-progress: trueconcurrency drops superseded runs for the same PR - 2
action_requiredruns (#4845, #4830) are unresolved and may require manual intervention
Action required: Verify DON_PETRY_BOT_GH_PAT has repo and read:org scopes and, if it is a fine-grained PAT, audit the scope-check script's compatibility with fine-grained PAT auth output format.
2. Failure Breakdown
| Failure Category | Affected Runs | Example Error Message |
|---|---|---|
Missing token scope (repo) |
#4788, #4801, #4815 | GH_TOKEN is missing required scope: repo |
| Action required (pending review) | #4845, #4830 | (status: action_required — no log available) |
3. Error Patterns
Category: Missing token scope — repo
Exact error (identical across all 3 runs):
✓ Logged in to github.com account donpetry-bot (GH_TOKEN)
- Active account: true
- Git operations protocol: https
- Token: github_pat_11CDFSYKQ0w50IHawIgb0w_***
##[error]GH_TOKEN is missing required scope: repo
##[error]Process completed with exit code 1.
Step: "Install review engine CLIs" — the scope-validation block that runs before any npm install:
scopes_line="$(printf '%s\n' "$auth_status" | grep 'Token scopes:' || true)"
normalized_scopes="$(printf '%s' "$scopes_line" | sed "s/[',]/ /g")"
required_scopes=(repo read:org)
for required_scope in "${required_scopes[@]}"; do
if ! grep -qE "(^|[[:space:]])${required_scope}([[:space:]]|$)" <<< "$normalized_scopes"; then
echo "::error::GH_TOKEN is missing required scope: ${required_scope}"
exit 1
fi
doneRoot cause (two candidate explanations):
-
Fine-grained PAT incompatibility (most likely). The token prefix
github_pat_11CDFSYKQ0w50IHawIgb0w_identifies it as a GitHub fine-grained PAT. Fine-grained PATs do not exposeToken scopes:ingh auth statusoutput the way classic PATs do — they show granular repository/account permissions instead. Thegrep 'Token scopes:'line returns empty,normalized_scopesis an empty string, and thereposcope check trivially fails even when the token has equivalent permissions. -
Token temporarily expired or rotated. All 3 failures hit within a ~44-minute window (01:21–02:05 UTC) on the same PR (PR Review Agent: make failure runs diagnosable and harden transient setup failures #353). Run #4816 (02:05:43) succeeded immediately after #4815 failed (02:05:38), suggesting the token was replaced/rotated mid-burst rather than being permanently invalid.
4. Token Scope Analysis
Token in use: DON_PETRY_BOT_GH_PAT → mapped to GH_TOKEN
Token type: Fine-grained PAT (github_pat_ prefix)
| Scope | Status | Evidence |
|---|---|---|
repo (full repo access) |
Missing / undetectable | Explicit error: GH_TOKEN is missing required scope: repo |
read:org |
Unknown — not reached | Check exits on first missing scope; read:org was never evaluated |
| Checkout / Contents | Present (runs completed checkout) | actions/checkout succeeded in all 3 failed runs before the scope check |
Recommendation per scope:
repo: IfDON_PETRY_BOT_GH_PATis a fine-grained PAT, replace it with a classic PAT that hasrepoandread:orggranted, OR update the scope-check script to handle fine-grained PAT output (which shows repository/account permissions, notToken scopes:). Fine-grained PATs are not supported by allghCLI scope-detection paths.read:org: Same resolution as above. Classic PAT needsread:org; fine-grained PAT needs "Members" read permission on the organization.write:discussion/pull-requests: The workflow'spermissions:block setspull-requests: writeon the GITHUB_TOKEN — that is separate and appears correct. No change needed there.
5. Recommendations
-
Audit PAT type and replace if fine-grained —
scripts/scope-check block inpr-review.yml(thegh auth statusvalidation inline in "Install review engine CLIs")- What: Determine whether
DON_PETRY_BOT_GH_PATis a fine-grained or classic PAT. If fine-grained, either (a) replace with a classic PAT bearingrepo+read:org, or (b) update the scope-detection logic to parse fine-grained PAT permission output instead of relying ongrep 'Token scopes:'. - Why: Fine-grained PATs produce no
Token scopes:line; the check always fails regardless of actual permissions. - Expected impact: Eliminates all 3 recurring failures; no more false-positive scope rejections.
- Urgency: CRITICAL — causes 100% failure for any run that hits this code path with a fine-grained PAT.
- What: Determine whether
-
Investigate and resolve
action_requiredruns #4845 and #4830- What: Check the Actions UI for pending deployment environment approvals or required review gates on runs #4845 and #4830.
- Why:
action_requiredstatus means the workflow is blocked waiting for a human; if left unattended these runs never complete. - Expected impact: Clears stalled runs; prevents silent queue backlog if environment protection rules are misconfigured.
- Urgency: HIGH
-
Pin
CLAUDE_CODE_VERSIONto a specific semver tag instead oflatest- What: Set the
CLAUDE_CODE_VERSIONActions variable (or hardcode in workflow) to a specific version, e.g.,1.x.y. - Why: Cache key
claude-code-latest-Linuxwill serve stale binaries until manually invalidated; a breaking CLI update will be silently picked up on cache miss. - Expected impact: Reproducible builds; controlled upgrades.
- Urgency: MEDIUM
- What: Set the
-
Add
read:orgto the PAT and verify with a dry-run dispatch- What: After resolving item test issue from agent #1, trigger a
workflow_dispatchwithdry_run: trueand confirmgh auth statusshows bothrepoandread:org(or equivalent fine-grained permissions) before re-enabling live runs. - Why: The scope check exits on the first missing scope —
read:orgwas never evaluated in the failed runs and may also be absent. - Expected impact: Prevents a second failure wave after
repois fixed. - Urgency: HIGH
- What: After resolving item test issue from agent #1, trigger a
6. Health Score
Health: 7/10 — Workflow is largely operational (60% pass rate on active runs) but carries a recurring, fully-preventable auth failure caused by a fine-grained PAT incompatibility with the classical scope-check logic.
Activity
don-petry commentedon Jul 14, 2026
Closing stale daily digest — superseded by the newest snapshot. Digest steps now close prior days automatically (#1204 / #1212).