Repository navigation
perf(pr-pipeline): defer the pr-merge arm run when the token budget is projected to run out - #17660
Conversation
…s projected to run out Add a defer gate to check-kill-switch. With `defer: "true"` on a first run attempt, its one GET /rate_limit stops the job (cause defer, the window's reset) while the window's burn rate projected to the job's horizon, or to the reset when sooner, leaves under github-token's defer-project share of the limit. It reads no start-gate floor, never waits, and a re-run attempt never defers. defer-project 0 turns it off. - deferGate reads defer-project and defer-run-minutes from the resolved config's limits.api over rate-limits.json (defaults 0.3 and 15); the gate's defer-minutes input sets the job's horizon. - pr-merge's enable-auto-merge gate defers only a PR-scoped arm run (inputs.pr), with a 6-minute horizon (p90 of 29 arm runs); the sweep recovers it and keeps switches only. The pr-merge-wake line names the deferral and the reset, and the gate logs a defer notice. - rate-guard.mjs admits both fields; the schema's api-pool admits them. - The GATES test gains the defer kind and checks that no CI Status or pr-dispatch-feedback gate defers. Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd
…nfig key The pr-merge arm gate no longer hardcodes defer-minutes "6". A new defer-job input names the job's horizon key, github-token's defer-run-minutes-<job> in limits.api over rate-limits.json, falling back to defer-run-minutes. defer-run-minutes-pr-merge defaults to 6, the p90 of 29 first-attempt arm runs (327 s), and pr-pipeline.yaml may override it; the schema's api-pool and rate-guard.mjs admit the key. Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd
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 #17660 (defer gate for pr-merge's PR-scoped arm run)No security issues found. I read every hunk of all 12 changed files. These trusted-path files got the full trust-control scrutiny: Kill switch ( Merge holds ( Deferral applies only when Config input. The new Shell and output handling. Token scope. No change: the defer read uses the existing Spend. Each PR-scoped pr-merge arm run makes one extra PR text. The description and linked issue context hold no embedded instructions. critical-findings: 0 |
|
claude-review reviewed CI code review: PR #17660 (head b95b653)No blocking or advisory findings. I read all 12 changed files in full in the diff. Three files match the trusted-path globs and got extra scrutiny: What I checked:
I have not run any tests. The PR's counts (84/84, 2,373/2,373, 51/51) are the author's claims and unverified. No Loosened checks would be marked: fail (default: the prompt carried no Spend: each PR-scoped pr-merge arm run makes one more GITHUB_TOKEN Verifier dropped 0 of 0 candidates. |
Refs: #17460
Summary
check-kill-switch gains a defer gate. On a first run attempt, it stops a job whose work a later run recovers while the GITHUB_TOKEN window is projected to have under
defer-projectof its limit left when the job would end. The stop carries causedeferand the window's reset. Only pr-merge's PR-scoped arm run defers, and the sweep recovers its work. CI Status and pr-dispatch-feedback never defer.Fix
deferGateand defer path: no start-gate floor and no wait, a re-run never defers, and 0 turns it off.defer,defer-job,defer-minutesandresolved-config.defer-project0.3,defer-run-minutes15 anddefer-run-minutes-pr-merge6 (the arm run's p90). Each can be overridden in pr-pipeline.yaml (schemaapi-pool).::notice title=defer::with the reset, and the wake line readsoutcome=deferred (cause defer) ... reset at <epoch>.deferkind.Verification
Related
Phase 1 of the #17460 plan. Deferral for the reviews and Check Intent waits on a separate owner decision.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd