ci: adopt the inline pr-agent lane — a public repo cannot call a private reusable workflow - #24
ci: adopt the inline pr-agent lane — a public repo cannot call a private reusable workflow#24yakimoto wants to merge 6 commits into
Conversation
🤖 CodeAnt AI — Review Status
|
Reviewer's GuideReplaces the broken reusable pr-agent workflow call with a fully inline, self-contained workflow definition tailored for public repos, and aligns it with the current reusable lane behavior (concurrency, retries, timeouts, and advisory verdict handling). Sequence diagram for PR-Agent retry and advisory verdictsequenceDiagram
participant G as GitHub Actions
participant A as PR-Agent action
participant L as LLM router
participant V as Verdict step
G->>A: Run attempt 1
A->>L: Review pull request
alt attempt 1 succeeds
A-->>G: success
G->>V: Evaluate outcomes
V-->>G: exit 0
else attempt 1 fails
A-->>G: failure
G->>G: sleep 45 seconds
G->>A: Run retry attempt 2
A->>L: Review pull request
A-->>G: success or failure
G->>V: Evaluate both outcomes
alt either attempt succeeds
V-->>G: exit 0
else reviewer failure or timeout
V-->>G: advisory warning, exit 0
end
end
Flow diagram for public PR-Agent event handlingflowchart TD
E[Workflow event] --> K[Concurrency key includes event name]
K --> T{Eligible event and PR?}
T -->|pull_request: non-draft, non-fork, non-bot| R[Run inline reviewer]
T -->|issue_comment: trusted slash command| R
T -->|otherwise| S[Skip job]
R --> B[6-minute attempt timeout]
B --> F{Attempt succeeds?}
F -->|yes| V[Verdict exits 0]
F -->|no| D[45-second backoff]
D --> X[Retry with 6-minute timeout]
X --> V
V --> O[Advisory result; reviewer failures do not block PR]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_23a3491f-7f08-4d72-8e19-85cd2be6c3c8) |
|
Warning Review limit reachedNext included review available in 26 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 91 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR replaces a small reusable-workflow reference with a credential-bearing, 345-line GitHub Actions implementation that changes PR automation, concurrency, retries, fork handling, and write behavior. An unresolved bot-filtering defect and security-sensitive review concern warrant human validation. Not approved because:
Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more. |
PR Reviewer Guide 🔍(Review updated until commit 7518c97)Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the workflow’s trust checks or pinned action usage are wrong, an untrusted pull request or comment could cause a secret-bearing reviewer to run with write-capable GitHub credentials, or could generate and commit unwanted code changes. Reverting the workflow stops future runs, but any exposed secret or already-created commit would require separate remediation.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR Summary by QodoCI: inline PR-Agent workflow so public repos avoid private reusable workflow
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
Note Automatic reviews are paused because your team has used its included automatic processing for this billing period (headroom scales with your seat count). You can still comment "Gitar review" to run one anytime, and automatic reviews resume on their own by September 1. Add seats for more headroom. Code Review ✅ Approved 2 resolved / 2 findingsAdopts an inline PR-Agent workflow to fix private reusable workflow failures in public repositories, but the bot-login substring check misses non-[bot]-suffixed bot accounts and the issue_comment slash-command lacks a fork check. ✅ 2 resolved✅ Bug: Bot-login substring check misses non-
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Gitar
PR Code Suggestions ✨No code suggestions found for the PR. |
Code Review by Qodo
1.
|
…ate reusable workflow This repo's pr-agent.yml calls `wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml`, and wave-foundation is PRIVATE. GitHub does not permit a PUBLIC repository to call a reusable workflow from a private one, so the `uses:` never resolves: the run dies before any job is created — conclusion: failure, total_count: 0, no log, and no check run on the head sha to read. Every PR here has carried a red check that reports nothing, and external contributors see it. Measured across the org 2026-08-22: 7 public repos / 176 runs / 100% failure; 9 private repos / zero failures — a clean 16/16 split on visibility alone. Three competing hypotheses (missing OPENAI_KEY, dead pinned ref, @main vs a pinned sha) were each tested and refuted. THE FIX already existed and was never adopted: wave-foundation-public/.github/workflows/pr-agent.yml is an INLINE copy of the same lane with no reference to the private repo. This adopts it verbatim. PROVEN BEFORE FANNING OUT. wave-certify#44 took this exact change first and its pr_agent run returned SUCCESS on the pull_request event — a job with a real log, where the broken form produced no job at all. 27 repos were not changed on hope. Two prerequisites named in wave-pen#388 are cleared as of wave-foundation-public#71: the shared concurrency key that let any bot comment cancel a live review ~10s in (wave-pen#386) now keys on github.event_name, and the lane carries step-level timeouts. The job id stays `pr_agent`, so the check-run context is unchanged and no branch protection rule needs touching. Refs wave-pen#388 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
3818080 to
7518c97
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3c532a69-f777-4f5c-a4cc-c31d488bca0d) |
|
Persistent review updated to latest commit 7518c97 |
Qodo Fixer✅ Merged (0) · ☑ Fixed (0) Process
|
…t classification Picks up wave-foundation-public#72, which landed after this PR was opened. The template this PR originally copied classified timeouts on TOTAL job time (attempt 1 + 45s backoff + attempt 2) against STEP_BUDGET_S=360, a PER-ATTEMPT budget. Two healthy-but-slow attempts (~180s each) were therefore reported as "TIMED OUT ... A hang, NOT a rate limit", and the else-branch claimed the run was "well inside the budget" from the same misused total. Found by qodo review on wave-monitor#48 and confirmed against the file. Now stamps each attempt separately and classifies on the LONGEST attempt, with if: always() end stamps so an attempt killed BY its step timeout still records one. Verified by dry-running both cases before the template landed. Updated in place rather than as a follow-up PR because this has not merged yet — cheaper, and it keeps the repo from ever carrying the defective version. Refs wave-av/wave-pen#417, wave-av/wave-pen#388
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_95c6c927-f406-4eb7-b945-a00dd0357114) |
…s step cap Re-syncs this PR to the hardened template before it merges, so it cannot land carrying the two defects it was opened with (wave-pen#418, wave-foundation-public#73). 1. Fork status is now RESOLVED, not assumed. The job-level `if:` refuses forks on the `pull_request` arm; it structurally cannot on `issue_comment`, because fork status is absent from that payload — measured, with a positive control: `issues/<n>.pull_request` carries exactly [diff_url, html_url, merged_at, patch_url, url], while `pulls/<n>.head.repo.fork` answers. A `fork gate` step asks the pulls endpoint and FAILS CLOSED: only a literal `false` proceeds; a 404, a revoked token, a rate limit and `.head.repo = null` all skip. Scope: this lane runs no `actions/checkout`, so fork code is never fetched or executed and no exfiltration path existed. The durable defect was the comment claiming "Forks skipped (no secrets there)" — true of one arm, false of the other, and exactly what would mislead whoever adds a checkout step later. 2. CONFIG__AI_TIMEOUT 600 -> 300, in both env blocks. 600s inside a 360s step is unreachable: the runner killed the step first, so pr-agent never reached its own timeout and never fell back to CONFIG__FALLBACK_MODELS. 3. A latent classifier bug the gate exposed: `stamp attempt 2 end` runs under `if: always()`, so when attempt 2 never ran the arithmetic subtracted from zero and reported a 1787580408-second attempt as a confident TIMED OUT. Fixed at the arithmetic; the verdict also gains an explicit `skipped` branch. The job id stays `pr_agent`, so the check-run context is unchanged and no branch protection rule needs touching. Refs wave-pen#418, wave-pen#417, wave-pen#388 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_abbf5067-bc19-4b5b-be6e-7535c1bcbee2) |
…ce of a true
Review of this wave found the fail-closed gate had a fail-OPEN consumer. Two
reviewers flagged it independently, on two different repos, and they were right.
if: steps.gate.outputs.fork != 'true' # grants when the output is EMPTY
The gate could only fail closed if it always wrote an output. It did, on every
path — so this did not fail open today, and the implicit success() on the
consumer covers a gate that errors outright. But the safety rested on an
argument rather than on the structure, and it is the very argument this change
exists to delete: absence must not read as permission.
Two independent changes, so neither carries the invariant alone:
- the gate now assigns a shell variable that STARTS at `true` and writes ONCE
at the end, so no future edit adding an early exit can emit nothing;
- the consumer requires `== 'false'`, an explicit affirmative, so an empty or
missing output skips the agent.
Also braces both sides of the A2 subtraction in the verdict step. The bare
`ATTEMPT2_START` was CORRECT — POSIX arithmetic expansion evaluates a bare name
as a variable, verified identical (180 == 180) — but a reviewer read it as a
literal token and filed it High. An expression that reads wrong on 27 repos gets
re-filed on 27 repos, so it is normalised rather than defended.
RECEIPTS. actionlint clean; zizmor clean; shellcheck clean. The gate was driven
through all six branches plus the reviewers' no-output scenario: only a literal
`false` reaches AGENT RUNS. The verdict was re-run across all six states and is
unchanged on the five that already worked.
LIVE: wave-av/api-spec merged the previous revision and its pull_request run
executed `fork gate (issue_comment only) -> success` in production, then ran the
agent — so the gate does not wrongly refuse a legitimate same-repo PR.
Upstream: wave-av/wave-foundation-public#73. Refs wave-pen#418, wave-pen#417.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_fd0b5eac-ecc9-4e5e-812c-ec9b62410397) |
…mber space Review found a SECOND concurrency collision, on a different axis from the one this template already documents (wave-pen#386). `issue_comment` fires for ISSUES as well as PRs, and GitHub draws both from ONE number sequence. So a comment on Issue #30 and a `/review` on PR #30 entered the same concurrency group. Concurrency is evaluated at WORKFLOW level, BEFORE the job-level `if:` runs — so the Issue comment cancelled the PR review already in flight, and was then skipped itself, having done nothing. That is the identical shape as the #386 defect the block above exists to fix, one axis over: a run that will not review taking the lane from the run that would have. #386 separated the two EVENTS; it did not separate the two number spaces inside one event. pull_request PR 433 -> pr-agent-pull_request-pr-433 issue_comment on PR 30 -> pr-agent-issue_comment-pr-30 issue_comment on ISSUE 30 -> pr-agent-issue_comment-issue-30 The last two used to be one group. actionlint and zizmor clean. Upstream: wave-av/wave-foundation-public#73. Refs wave-pen#418, wave-pen#417. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_663b918b-a090-48d3-b012-0a501cf20ab0) |
A reviewer flagged the missing entry on wave-modules#41. 25 of the 28 repos in this wave keep the same Keep-a-Changelog convention, so the entry lands in all of them rather than only the repo whose review happened to catch it — fixing the reported instance and leaving the class is the pattern this wave keeps undoing. The change IS user-visible, which is why it belongs here: a maintainer's `/review` on a fork PR is now declined with a warning instead of silently running, so contributors on forks see different behaviour. Refs wave-pen#418, wave-av/wave-foundation-public#73 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_9c68c375-8539-4962-8408-f0372f2d4b8d) |
Review disposition — every finding on this PR, actioned or refuted with evidenceThis branch has been updated. Reviews across this wave raised nine distinct findings; four were real and are fixed, three are working-as-intended, two are refuted with measurements. Nothing was silently skipped. Source of truth for the template: wave-av/wave-foundation-public#73. Tracked as wave-pen#418. Fixed — the reviewers were right
Refuted — with the measurement, not an opinion
GitHub is following an org rename (Codium-ai → qodo-ai → The-PR-Agent) transparently. The suggested remedy would make things worse:
Normalised anyway. An expression that reads wrong on 27 repos gets re-filed on 27 repos, so consistency is worth more than being right about it. Committable suggestions lack Working as intended
One defect no reviewer found, surfaced by fixing the first
A 56-year attempt, stated as a confident diagnosis. Latent since #72; the fork gate is simply the first path that reaches it. Fixed at the arithmetic, and the verdict gained an explicit Receipts
|
|
One correction to the disposition comment above: it tabulated eight findings and omitted one that was raised on this PR — gitar-bot's "Bot-login substring check misses non- It is filed as wave-pen#419 with the reasoning, so it survives this PR merging. Short version: real, pre-existing, and deliberately not fixed here. The issue also records the trap: gating on |
User description
User description
User description
User description
User description
Part of the fan-out tracked in wave-pen#388, proven first on wave-certify#44 where
pr_agentreturned success.The defect
pr-agent.ymlhere callswave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@main, and wave-foundation is private. GitHub does not permit a public repository to call a reusable workflow from a private one, so theuses:never resolves: the run dies before any job is created —conclusion: failure,total_count: 0, no log, and no check run on the head sha at all.That is worse than a normal failure. There is nothing to click through to. Every PR on this repo has been carrying a red check that reports nothing, and external contributors see it.
Measured on this repo today — the last 5
pr-agentruns:Measured across the org on 2026-08-22: 7 public repos / 176 runs / 100% failure; 9 private repos / zero failures. A clean 16/16 split on visibility alone. Three competing hypotheses were each tested and refuted — missing
OPENAI_KEY(present in both populations), a dead pinned ref (150ffae2resolves, file exists at it), and@mainvs a pinned sha (wave-realtime-edgepins@mainand fails,wave-penpins@mainand works).The fix already existed and was never adopted
wave-foundation-public/.github/workflows/pr-agent.ymlis an inline copy of the same lane with no reference to the private repo. Its own header says it was written for exactly this. This PR adopts it verbatim.So this is an adoption gap, not a design gap.
Why now, and not when #388 was filed
#388 named two blockers, and both are cleared as of wave-foundation-public#71:
pr-agent-${{ github.event.pull_request.number || … }}, shared betweenpull_requestandissue_comment, so any bot comment cancelled a live review ~10s in (wave-pen#386). It now keys ongithub.event_name.Fanning out before those landed would have traded a red-with-no-log lane for a cancelled-on-every-comment lane — a different failure, not a fix.
Verified before opening this
wave-foundation/mentions are in comments, not in auses:. Checked rather than assumed, since that is the whole property this depends on.pr_agent. A job's id is its check-run context and branch protection matches on(context, app_id), so nothing needs touching on the protection side.wave-foundation-public's default branch — not from a local checkout that might be parked on another branch.The receipt is this PR, not the diff
A red lane and a working lane are indistinguishable until one actually runs — that is the whole reason 176 failures went unexamined. So the proof is
pr-agentgoing green on this PR. If it does, the remaining 27 repos get the same change with evidence behind it. If it does not, we learn that here, on one low-traffic repo, instead of across the org's entire public surface.Proven before fanning out. wave-certify#44 took this exact change first and its
pr_agentrun returned success on thepull_requestevent — a job with a real log, where the broken form produced no job at all. The other repos were not changed on hope.Refs wave-pen#388
Note
Medium Risk
CI-only, but the job holds OPENAI_KEY and PR write permissions; fork gating and fail-closed shell logic are security-sensitive even though there is no checkout of fork code.
Overview
Replaces the broken
uses:of privatewave-foundationreusable workflow with a self-containedpr-agent.yml. Public repos cannot call private reusable workflows, so the old lane failed with zero jobs and no logs.The inline lane keys concurrency on event name plus pr-vs-issue so comments no longer cancel in-flight reviews. Slash commands stay PR-only and member-gated. Fork PRs are refused on
pull_requestin the jobif:, and onissue_commentvia a fail-closedgh apifork gate (only a literalfalseproceeds).Adds a 6-minute per-attempt timeout,
CONFIG__AI_TIMEOUTof 300s, one retry after 45s, and a verdict step that classifies success, skip, cancel, hang, and rate-limit without blocking the PR. Changelog documents the fork-gate, timeout, and stamp-arithmetic fixes.Reviewed by Cursor Bugbot for commit 55f9b69. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by Sourcery
Restore a reliable, advisory-only PR-Agent lane for this public repository.
Bug Fixes:
Enhancements:
CI:
PR Type
Bug fix, Enhancement
Description
Replaced private workflow reference with inline PR agent configuration
Fixed fork handling for slash command reviews
Added timeout budgeting and retry logic for reliability
Improved error classification and reporting
Diagram Walkthrough
flowchart TD A["pr-agent.yml"] --> B["Fork Gate Check"] B --> C{Fork?} C -->|Yes| D["Skip with warning"] C -->|No| E["Attempt 1 (6min)"] E --> F["Stamp Start"] E --> G["Run PR Agent"] G --> H{"Success?"} H -->|Yes| I["Exit"] H -->|No| J["Retry after 45s"] J --> K["Attempt 2 (6min)"] K --> L["Stamp End"] L --> M["Verdict Classification"]File Walkthrough
pr-agent.yml
Inline PR agent workflow with enhanced reliability.github/workflows/pr-agent.yml
CHANGELOG.md
Updated changelog with workflow improvementsCHANGELOG.md