Repository navigation
perf(pr-pipeline): defer hosted reviews on a short token window and recover them after the reset - #18054
perf(pr-pipeline): defer hosted reviews on a short token window and recover them after the reset#18054kyle-sexton wants to merge 3 commits into
Conversation
…ecover them after the reset Both hosted review callers' gates defer a first attempt while the GITHUB_TOKEN window is projected to run short before the review ends (defer-job review, defer-run-minutes-review 11, the measured p90). The stop notice prints cause= and reset=. The lost-run reconciler reads that reset, waits a minute past it, then re-runs the run once, recorded, in a DEFER_MAX band of 12 re-runs a pass beside the 3 existing places; the workflow gains record uploads 4 to 15. Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RAoAtST8QdquPzTRsKGF4Y
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. |
…reconciler suite's workflow reads Each record upload 4 to 15 follows its own scan-upload step, as the artifact-retention table requires. reconcile.test.mjs declares its .github/workflows reads, and the callers test expects the hosted gates' defer inputs. Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RAoAtST8QdquPzTRsKGF4Y
|
claude-security-review reviewed Security review (incremental, blocking only): no findingsI reviewed the change since What the change does:
Why there is no security surface:
The review was blocking only (this lane already reviewed an earlier head). My earlier summary comment had no findings, so I have nothing to restate. No settled threads apply, and the incremental diff contains no embedded instructions. This change adds no spend. critical-findings: 0 |
|
claude-review reviewed Code review (incremental, blocking only): b35ac17 since dd69adfScope. One file changed since the last review: Overview. The new test does what the owner said it does when they resolved this lane's earlier finding on
The earlier thread is resolved and its lines have not changed since, so it stays settled. No blocking finding is new in this push. Not checked by the new test (advisory, dropped under blocking only). The test name says "scanned" upload step, but it does not check that each upload has a scan step or reads that scan's Closing issue. The PR says only Loosened checks. The wrapper sent no Verification. I ran nothing; this lane has no shell. Whether the new test passes is the author's claim and unverified. Review mode. Blocking only: this lane already reviewed an earlier head. Verifier dropped 0 of 0 candidates. |
Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RAoAtST8QdquPzTRsKGF4Y
Refs: #17460
session: AI Hero
Summary
Phase 2 of the #17460 option B plan, under the owner's OQ1 decision (2026-11-21, about 4:35 PM EST: option (a), "Build Phase 2 (Recommended)"). Busy token windows now delay the two hosted reviews instead of letting them spend into the brake, and a dedicated recovery band in the lost-run reconciler re-runs each deferred review after the reset it names.
This changes what the unattended review lanes do under load. The owner decided that in OQ1 above. On 2026-11-21, about 4:50 PM EST, the owner also accepted the merge latency this adds on busy days ("Accept, then measure"). Phase 8 reports the deferral backlog and the p90 merge latency on #17460.
Fix
pr-review-hosted.ymlandpr-review-security-hosted.yml: the gate setsdefer: "true",defer-job: reviewandresolved-config, sopr-pipeline.yamloverrides apply. The stop notice keeps its prefix, which the merge gate matches, and now printscause=<cause> reset=<epoch>.rate-limits.jsonandrate-guard.mjs:defer-run-minutes-reviewis 11. Basis: the p90 of the 418 hosted review runs that ran 2 minutes or more, among the 300 newest of each caller, is 10.4 minutes (gh run list, read 2026-11-21). The schema, thepr-pipeline.yamlcomment and both READMEs name the key.reconcile.mjs(Review kind):DEFER_NOTEwaits untilRATE_RESET_GRACE_MSpast its reset and counts as a wait, so the pass writes noclean. It is re-run once after that.DEFER_MAXband of 12 per pass, a head's two lanes together, beside the 3 existing places. A full set of flake or floor re-runs no longer blocks them, and they do not block those.recordOutputswritesrecord-1torecord-15, and the workflow gains upload steps 4 to 15. Record matching is unchanged: one artifact per record name..workreplay of the gate (projection.mjs, share 0.3, 11-minute horizon) over thegh-job-callslog for the 24 h to 2026-11-21T20:49Z.:04tick. Every window that would have deferred reset between :50 and :55 (12 of 12), so that tick runs 9 to 14 minutes after the reset. A window that resets at another minute waits for the next tick.Verification
node --test --test-concurrency=4overcheck-kill-switch/*.test.mjs,maintenance-reconcile-lost-runs/*.test.mjsandpr-unblock/fix-ci-dispatch.test.mjs: 450 pass. The run on the other readers of the changed workflows (pr-review-mainworkflow.test.mjs, check-upstream-status, log-api-budget, workflow-gates, lane-binding-wiring, check-trusted-trigger) also passed: 805 tests.bash scripts/ci-review-lanes.test.sh(PASS=295) andbash scripts/ci-rerun-ci-status.test.sh(PASS=324).reset + RATE_RESET_GRACE_MSand is re-run after it, including a run created before the last pass.DEFER_MAXper pass and the rest waiting.DEFER_NOTE.defer-run-minutes-reviewdefault is pinned, and both callers are classified asdefergates.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01RAoAtST8QdquPzTRsKGF4Y