Repository navigation
fix(pr-pipeline): wait out a near reset instead of dropping a Refine dispatch - #17411
Conversation
…dispatch A Refine dispatch on a pull request and intake's issue refinement each had one sender: the event's own run. A GitHub token budget stop dropped it, and nothing sent it again after the reset. - pr-unblock-dispatch's refine job sets API_BUDGET_WAIT_SECONDS 1200, so the rate guard waits out a stop whose reset is near and then sends the pr-refine dispatch, instead of ending red. - check-kill-switch takes a wait-seconds input. A budget stop whose reset is inside it waits for the reset and reads the budget once more. Only intake's refine-select sets it. - Both jobs' timeouts rise to 30 minutes to hold the wait. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review: PR #17411 (cb82a37)No security issues found. I read every hunk of all 8 changed files. Two of them are on trusted paths: What I checked
Spend (not a hold, not counted as a finding): critical-findings: 0 |
|
claude-review reviewed Code review: no blocking findingsI read all 8 changed files in full. The change gives two dispatch paths a way to wait out a near rate-limit reset instead of dropping their work:
What I checked:
Minor, not counted as a finding: the module header of Spend, not a hold: a budget stop near its reset can now keep a GitHub-hosted Other review inputs:
Loosened-check verdict: fail (lane default; no verdict or patterns line in the prompt); patterns: 0 Verifier dropped 0 of 0 candidates. |
No related issue: friction fix from the 2026-11-19 gh-monitor run. Dispatches that a GitHub token budget stop dropped were never sent again after the reset.
Summary
The pr-refine dispatch for a pull request, and intake's issue refinement, can each be sent only by the run of the event that started them. A token budget stop near a reset dropped both, and nothing re-sent them:
start-gate ... remaining=313 ... stop=true, reset 06:47:00Z (about 8 min out). test: isolate throwaway test repositories from global git config #17304 and chore(ecosystems): keep tool-pin only where the repository owns the version #17311 got no refinement. Admission then refused them, because its criteria-only wait needs that refinement.Fix
Both jobs now wait out the reset, using the wait budget the rate guard already has (D410/D417 pattern), rather than adding a re-send path.
refinejob: setsAPI_BUDGET_WAIT_SECONDS: "1200". The rate guard's patient latch waits out a stop-floor or refused answer whose reset is within 1200 s, then sends the POST. The event, sender and attempt stay the same, so the trusted-trigger rules (ADR 0090) are unchanged.check-kill-switch: new opt-in inputwait-seconds. When a budget stop's reset is inside it, the job sleeps to one second past the reset, reads/rate_limitonce more (a secondary-limit call, no core spend), and decides again with the projection gate still on. Only intake'srefine-selectsets it. The other 15 start gates do not, so they don't all start at the reset./rate_limitread for each stop it waits out.started after the resetin the start-gate notice.POST .../pr-refine.yml/dispatches waits Ns for GitHub's rate limit to reset.Not covered: a manual kill switch has no reset to wait for. A stop more than 20 minutes before its reset still drops, as it does today. The PR Review legs and merge-group CI Status run in other workflows.
Verification
check-kill-switch.test.mjs: tonight's 467 s stop waits once and starts; a stop still low after the reset stops again with its new reset; a reset past the budget stops at once; no or invalidwait-secondsnever waits; a switch stop never waits; refine-select is the only job that waits, and its timeout holds the wait.workflow-gates.test.mjs: the refine dispatch step's wait equalsWAIT_BUDGET_SECONDS.workResolveIssue, inside the job timeout.node --testover check-kill-switch, workflow-gates, refine-event-dispatch, rate-guard, and every other suite that reads the three changed files: 0 failures.Related
rate-guard.mjs, so the two do not conflict.🤖 Generated with Claude Code