fix(pr-review-sweep): dispatch with GH_PAT_WORKFLOWS, not the bot comment PAT - #756
Conversation
…ment PAT The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
Warning Review limit reached
More reviews will be available in 36 minutes and 10 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #756 |
|
Note @don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 0024ee473c40c16635194c0d2a6831c546d69237
Cascade: triage → audit (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5)
Summary
PR swaps the stuck-review sweep's dispatch token from the bot comment PAT (lacks actions:write, caused silent HTTP 403) to GH_PAT_WORKFLOWS, the established workflow-dispatch PAT used by 11 other workflows, and adds a fail-fast guard mirroring initiative-planner.yml. Paranoid review found no actual vulnerability: the privilege elevation is justified and matches repo norms, the guard only tests secret emptiness (no leakage), workflow permissions remain least-privilege (contents: read), and the secret is passed via env with no expression-injection surface. Confident the change is safe; risk held at MEDIUM because it handles secrets in a GitHub Actions workflow.
Findings
- INFO: Token swap (DON_PETRY_BOT_GH_PAT -> GH_PAT_WORKFLOWS) is a justified privilege elevation. The dispatch requires actions:write; scripts/sweep-stuck-reviews.sh header documents 'a PAT with workflow scope (required at the call site)'. GH_PAT_WORKFLOWS is the standard dispatch PAT across 11 workflows (initiative-planner/-driver, auto-rebase-retry, actions-fleet-monitor, etc.). This PR does not alter the secret itself, only references it, so it introduces no new exposure beyond existing repo norms. Note: a secret's underlying PAT scope cannot be introspected from a PR review; that is an org-admin concern and is unchanged by this PR. (
.github/workflows/pr-review-sweep.yml:76) - INFO: New guard step tests only emptiness of the secret (-z) and never echoes its value — no secret leakage. Pattern is an exact mirror of initiative-planner.yml:74-83. Secret is provided via the step env (not inlined into the run body), so there is no GitHub Actions expression-injection surface. (
.github/workflows/pr-review-sweep.yml:59) - INFO: Workflow retains least-privilege posture: top-level 'permissions: contents: read', no pull_request_target, checkout action pinned to commit SHA (df4cb1c, v6.0.3), concurrency cancel-in-progress. No supply-chain or lockfile changes (single workflow file touched). (
.github/workflows/pr-review-sweep.yml:44) - INFO: Root-cause confirmed at the dispatch site: a failed 'gh workflow run' emits only ::warning:: (not a non-zero exit), so the job reported success while dispatching zero reviews. Switching to the workflow-scoped PAT plus the loud guard resolves the silent no-op. (
scripts/sweep-stuck-reviews.sh:111) - INFO: Two CANCELLED checks (dev-lead / dispatch, dev-lead / ci-relay) are concurrency-cancelled dev-lead jobs — the known false-positive class addressed by commit 29e5974. All substantive gates (Lint, ShellCheck, CodeQL, gitleaks, SonarCloud, unit-tests, AgentShield, validate-agent-profiles) are green.
Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5). Reply if you need a human review.
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
|
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: bbf7c15c657db027e37aa5f5dfa0830591380e20
Review mode: triage-approved (single reviewer)
Summary
Single-file fix to the hourly stuck-review sweep workflow. Swaps the dispatch GH_TOKEN from DON_PETRY_BOT_GH_PAT (comment PAT, lacks actions:write → HTTP 403) to GH_PAT_WORKFLOWS (workflow/actions:write scope), adds a fail-fast guard for a missing PAT, and corrects the now-stale header comment. +23/-5 in .github/workflows/pr-review-sweep.yml only.
Linked issue analysis
No closing-issue reference attached. The PR body is a thorough self-contained diagnosis: the sweep silently re-triggered zero reviews because its dispatch PAT lacked actions:write, leaving 56 green PRs unreviewed. The fix directly addresses that root cause.
Findings
No blocking findings.
- Secret handling is safe: the change only swaps which secret name is referenced; no secret value is echoed. The new guard tests
[ -z "${GH_TOKEN}" ]only — no leakage. - Strong in-repo precedent confirmed: GH_PAT_WORKFLOWS is referenced by 9 other dispatching workflows (initiative-driver, dev-lead, actions-fleet-monitor, pr-review-mention, etc.), so the secret is established and the swap is consistent with org convention.
- The added guard step mirrors initiative-planner.yml and converts a silent no-op into a loud failure — a net robustness improvement.
- Diff only touches the workflow YAML; sweep-stuck-reviews.sh is unchanged.
CI status
Net green. Every distinct check reports SUCCESS; the CANCELLED duplicates (Lint, ShellCheck, holdout-guard, gitleaks, dev-lead dispatch/ci-relay, etc.) are concurrency-cancelled superseded runs — the known #608/#609 dev-lead pattern. The only IN_PROGRESS check is this review job itself. reviewDecision is already APPROVED.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: bbf7c15c657db027e37aa5f5dfa0830591380e20
Cascade: triage → audit (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5)
Summary
Paranoid audit of PR #756 confirms a security-positive, single-file change: the stuck-review sweep's dispatch token is swapped from the bot comment PAT (DON_PETRY_BOT_GH_PAT, lacks actions:write, caused a silent HTTP 403 no-op) to GH_PAT_WORKFLOWS, the established workflow-dispatch PAT verified in use by 9+ other workflows. No actual vulnerability: the privilege change is justified and matches repo norms, the new guard only tests secret emptiness (-z) and never echoes it, the secret is passed via step env so there is no expression-injection surface, and the workflow keeps least-privilege posture (contents: read, no pull_request_target, checkout pinned to commit SHA). All substantive CI gates are green; the only CANCELLED checks are the known dev-lead concurrency false-positive class. Risk held at MEDIUM solely because the change handles secrets in a GitHub Actions workflow.
Findings
- INFO: (
.github/workflows/pr-review-sweep.yml:76) Token swap DON_PETRY_BOT_GH_PAT -> GH_PAT_WORKFLOWS is a justified privilege change. The dispatch (gh workflow run pr-review-trigger.yml) needs actions:write, which the comment PAT lacks. Confirmed GH_PAT_WORKFLOWS is the standard dispatch PAT used across 9+ repo workflows (initiative-driver, dev-lead, actions-fleet-monitor, token-report, etc.). The PR only references the secret, adding no new exposure; the secret's underlying scope is an org-admin concern not introspectable from a PR and unchanged here. - INFO: (
.github/workflows/pr-review-sweep.yml:59) New guard step tests only emptiness of the secret (-z) and never echoes its value, so there is no secret leakage. The secret is provided via the step env rather than inlined into the run body, so there is no GitHub Actions expression-injection surface. - INFO: (
.github/workflows/pr-review-sweep.yml:45) Confirmed in head file (bbf7c15): top-level permissions are contents: read only, no pull_request_target, actions/checkout pinned to commit SHA df4cb1c (v6.0.3), concurrency cancel-in-progress. Single workflow file touched; no lockfile or supply-chain changes. - INFO: All substantive CI gates green (Lint, ShellCheck, gitleaks, CodeQL/Analyze python+actions, SonarCloud, AgentShield/Agent Security Scan, unit-tests/bats, validate-agent-profiles, holdout-guard, gh-aw-compile, CodeRabbit). dependency-audit subjobs SKIPPED (no dependency changes). Only CANCELLED checks are dev-lead/dispatch and dev-lead/ci-relay, the known concurrency-cancelled false-positive class addressed by commit 29e5974; older CANCELLED Lint/ShellCheck/etc each have a superseding SUCCESS rerun. review/review IN_PROGRESS is this cascade itself.
- INFO: Re-review: prior full cascade APPROVED at 0024ee4. The two newer commits (e69d92b, bbf7c15) are clean merge-from-main commits; PR diff is unchanged (1 file, +23/-5). No new substantive findings.
Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5). Reply if you need a human review.
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>
…ment PAT (#756) The stuck-review sweep is the only mechanism that re-triggers pr-review for PRs skipped while CI was pending/failing and later went green (#573). It was wired to DON_PETRY_BOT_GH_PAT — the bot's comment-posting PAT, which lacks the workflow/actions:write scope — so every 'gh workflow run pr-review-trigger.yml' dispatch returned HTTP 403 and the sweep 'succeeded' while re-triggering nothing (latest run: 97 inspected, 56 stuck-green, 0 dispatched). Result: open PRs org-wide sat at REVIEW_REQUIRED + green CI, never re-reviewed. Switch GH_TOKEN to GH_PAT_WORKFLOWS, matching every other dispatching workflow in the repo (initiative-planner.yml, initiative-driver.yml, auto-rebase-retry.yml, scripts/initiative-planner/redispatch.sh — cited in the sweep's own header as the same constraint). Add a fail-fast guard so a missing PAT errors loudly instead of silently no-op'ing, and correct the now-inaccurate header comment. https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp Co-authored-by: Claude <noreply@anthropic.com>



Diagnosis: why open PRs aren't being reviewed
The event-driven PR-review trigger (
pr-review-trigger.yml) works correctly — it reviews PRs on review events and legitimately skips PRs whose CI is still pending/failing (decision: skip, reason: ci-pending), deferring them to a latercheck_suite:completedevent.The safety net for PRs that go green after the last trigger fired is the hourly stuck-review sweep (
pr-review-sweep.yml, #573). That sweep is the only mechanism that re-triggers those reviews — and it was broken.Root cause
The sweep passed
DON_PETRY_BOT_GH_PAT(the bot's comment-posting PAT, which lacks theworkflow/actions:writescope) asGH_TOKEN. Everygh workflow run pr-review-trigger.ymldispatch therefore failed:The sweep job reported success every hour while re-triggering zero reviews, so the failure was silent. Net effect: 56 PRs org-wide sat at
REVIEW_REQUIREDwith green CI, never re-reviewed.Every other dispatching workflow in this repo uses
GH_PAT_WORKFLOWSfor exactly this —initiative-planner.yml,initiative-driver.yml,actions-fleet-monitor.yml,auto-rebase-retry.yml, andscripts/initiative-planner/redispatch.sh(which the sweep's own header cites as "the same constraint"). The sweep was the lone outlier.Fix
GH_TOKENfromDON_PETRY_BOT_GH_PAT→GH_PAT_WORKFLOWS(the PAT withworkflow/actions:writescope).GH_PAT_WORKFLOWSerrors loudly instead of silently no-op'ing (mirrorsinitiative-planner.yml).Verification / notes
GH_PAT_WORKFLOWSis configured as an org/repo secret (it is — used by the workflows listed above). If it ever isn't, the new guard now fails the run with a clear message rather than dispatching nothing.https://claude.ai/code/session_01UaUWBEtVnsouNCkK1LsMWp
Generated by Claude Code