You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(ci): pace GITHUB_TOKEN spend so busy hours stop tripping the kill switch #17460
The repository's GITHUB_TOKEN pool (5,000 calls/h) runs out in every busy hour, which sets the CI kill switch: 15 trips on 2026-11-18 and 9 on 2026-11-19, each 0-14 minutes before the hourly reset. CI spent 103,065 calls in 24 h (4,294/h average). Quiet hours (29-43 runs/h) did not trip.
Cause
The brake drives its own cycle: on BRAKE-CLEAR the hub dispatches pr-merge and work-unblock at once (token-headroom.sh:124), and lanes check the budget only when they start, so jobs already running spend it to 0%. 15 of the last 26 trips were refusals (calls already rejected).
Top consumers (calls/h, from limits/gh-job-calls.jsonl): CI Status 586; pr-merge.yml 727 over three jobs (PR-scoped runs ~92 calls each, mostly listing other workflows' runs); pr-dispatch-feedback 536; Check Intent 288; reconcile-lost-runs 200 (30-minute cron); Wait For Refine 161 (a poll duplicated in the two review workflows).
Done when
Spend is paced across the hour (no burst dispatch at BRAKE-CLEAR; running jobs check headroom before each costly phase), and a 24 h window shows at most a few trips.
Run lists are filtered by head SHA in pr-merge.yml; (the review keeps its Wait For Refine poll: owner decision D34, melodic-software/architecture#159;) reconcile-lost-runs runs hourly; pr-dispatch-feedback is gated with if: so it does not start for events it ignores. Expected saving ~330-570 calls/h.
The before/after calls per hour for each consumer are recorded from limits/gh-job-calls.jsonl.
Measurements and file:line basis: the API usage investigation of 2026-11-19 (read-only; numbers from logs the hub already writes).
Size: Medium
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: none
Blast radius: the review and Check Intent workflows, a new recovery workflow or step, and their tests; every CI run that spends GITHUB_TOKEN calls.
Reversible: yes; revert the workflow and test changes.
Open questions: none
Decision recorded. The owner's rule of 2026-11-20 (comment above: "Build (a) only if that run shows at least 3 zero windows"; pre-set rule "at least 3 zero windows: build Phase 2 ... with the post-reset recovery pass") is applied as written. The busy-day re-measure of 2026-11-21 (24 h ending 20:49:50Z) counted 3 of 50 token windows at core_remaining == 0, which meets it. The note that two of the three coincided with a host overload does not change the rule. Recorded by the hub, applying the owner's rule.
Done before this: the reconciler runs hourly, pr-dispatch-feedback jobs are gated with if:, and the merges listed in the 2026-11-20 measurement.
Left for the lane: review and Check Intent deferral on projected token budget; a post-reset recovery pass with its own in-flight cap; tests for the deferral and the cap.
This decision settles the open questions. The remaining work is the three lane items listed in it. The quiet-host re-measure is host work and is not a lane item. Merged #17508, #17517, #17531 and #17533 already cover earlier parts of this issue.
Claimed by the GitHub Optimization session (owner's local login), with the hub's agreement. It ships one small PR per consumer, each with before/after calls per hour from limits/gh-job-calls.jsonl.
Correction to my first version of this comment: the per-consumer numbers in the issue body stand. The log writes one row per job per rate-limit reset window (limits-sampler.sh, the row function's comment), so repeated (run, job) rows are window parts, not duplicates. Over the last 24 h the rows sum to 104.5k calls, against 109.6k on the token pool's own counter across 57 windows.
The work-resolve-issue lane stopped partway through this issue and needs a person.
Reason: security
Matched security word: token. A match holds the stop whether or not the text names a risk, so read the word in context below.
Why, in the run's own words:
patch-protected-path: .github/workflows/pr-verify.yml (and .github/workflows/maintenance-reconcile-lost-runs.yml). The recorded decision's first item, Check Intent runs deferring on the projected token budget, needs the Check Intent job's check-kill-switch step in .github/workflows/pr-verify.yml (line 145) to pass defer: "true", defer-job and resolved-config, plus a step that writes the defer config, as pr-review-hosted.yml:108-126 does. The second item, a recovery pass a few minutes after each hourly token reset, needs a trigger change in .github/workflows/maintenance-reconcile-lost-runs.yml: today it runs only on cron "4 * * * *" (line 73), and the token resets drift (07:51Z, 18:55Z, 19:55Z in the 2026-11-21 re-measure). The lane cannot push a change to .github/workflows/**.
What the run says it did not do:
Check Intent deferral: needs .github/workflows/pr-verify.yml, a protected path
Post-reset recovery pass with its own in-flight cap: needs a trigger change in .github/workflows/maintenance-reconcile-lost-runs.yml (or a new workflow), a protected path
Tests for the deferral and the recovery pass's cap: they depend on the two workflow changes above
Tidy, review, build and test: not run, because the run stopped before any edit and the working tree is unchanged
Hub: the 22:45Z stop matched token in "projected token budget" (the GITHUB_TOKEN API budget), not a secret or account risk. The real stop is the protected path: both items change .github/workflows/, which lane tokens may not push (hub Q1, 2026-10-30). Routed host-run; the hub builds it in a session worktree against the recorded decision.
Activity
github-actions commentedon Nov 19, 2026
Size: Medium
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: none
Blast radius: the review and Check Intent workflows, a new recovery workflow or step, and their tests; every CI run that spends GITHUB_TOKEN calls.
Reversible: yes; revert the workflow and test changes.
Open questions: none
Link: #17460 (comment)
This decision settles the open questions. The remaining work is the three lane items listed in it. The quiet-host re-measure is host work and is not a lane item. Merged #17508, #17517, #17531 and #17533 already cover earlier parts of this issue.
Automated triage. A maintainer reviews it.
melodic-automation-lanes commentedon Nov 19, 2026
{"v":1,"actor_id":337595936,"title_sha256":"b9d79e15394684868e80dd7492faaedb551014eb2b4db489528839f82149d267","body_sha256":"7c49fed3fd14618dbcda30edd82e1622d413fc637aa019dc1ad47e1a0cb4f825"}
melodic-automation-lanes commentedon Nov 19, 2026
{"v":1,"actor_id":337595936,"title_sha256":"b9d79e15394684868e80dd7492faaedb551014eb2b4db489528839f82149d267","body_sha256":"7c49fed3fd14618dbcda30edd82e1622d413fc637aa019dc1ad47e1a0cb4f825"}
kyle-sexton commentedon Nov 19, 2026
Claimed by the GitHub Optimization session (owner's local login), with the hub's agreement. It ships one small PR per consumer, each with before/after calls per hour from limits/gh-job-calls.jsonl.
Correction to my first version of this comment: the per-consumer numbers in the issue body stand. The log writes one row per job per rate-limit reset window (limits-sampler.sh, the row function's comment), so repeated (run, job) rows are window parts, not duplicates. Over the last 24 h the rows sum to 104.5k calls, against 109.6k on the token pool's own counter across 57 windows.
chore(pr-pipeline): delete route rule comments the workflow-file chan…
fix(pr-pipeline): point api_route at the route vectors and drop a fal…
fix(pr-pipeline): pin the dispatcher's ticks and drop the last half-h…
test(pr-pipeline): expect the workflow file name in dispatch-full-run…
21 remaining items
github-actions commentedon Nov 22, 2026
melodic-automation-lanes commentedon Nov 22, 2026
The work-resolve-issue lane stopped partway through this issue and needs a person.
Reason:
securityMatched security word:
token. A match holds the stop whether or not the text names a risk, so read the word in context below.Why, in the run's own words:
What the run says it did not do:
Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/45076645727
To retry, set Work status to agent-ready again (clearing the
needs-humanhold).kyle-sexton commentedon Nov 22, 2026
Hub: the 22:45Z stop matched
tokenin "projected token budget" (the GITHUB_TOKEN API budget), not a secret or account risk. The real stop is the protected path: both items change.github/workflows/, which lane tokens may not push (hub Q1, 2026-10-30). Routedhost-run; the hub builds it in a session worktree against the recorded decision.perf(pr-pipeline): tick the reconciler quarter-hourly and pass once a…
test(ci): list reset-tick.mjs's /rate_limit read among the unguarded …
fix(pr-pipeline): count a pass that waited out the reset grace as its…
fix(reconcile): follow up only when every ci-status failure is a revi…
fix(reconcile): keep re-running stopped reviews beside kill-switch an…
fix(reconcile): accept pending and missing review notes, and tie floo…
fix(reconcile): tie run and job companions to their floor note's call
fix(reconcile): tie the push-history companion to its floor note by b…