Repository navigation
Description
This was generated by AI during triage.
What happened
On 2026-11-12, every host in the fleet (all on v0.30.0) stopped work for about an hour while GitHub had almost all of its quota left.
- ~10:37 EST: GraphQL fell below the 500-point reserve. Passes skipped with
GitHub Quota wait until 2026-11-12T15:58:05Z (graphql: 400 left), as designed. - 10:58 EST (15:58Z): GraphQL reset to 5000.
- From 10:48 EST on, every host instead logged
GitHub Quota wait until 2026-11-12T16:46:42Z (graphql: 4995 left)and skipped every Pickup, Fix, Review, Triage and Architect run until 11:46 EST. - Commands already running stopped mid-run too. The Console showed Ticket runs A Security run on a repository with issues turned off fails at Security fix publishing #2094 (Lima), tourbot Fold skipped Pass messages while Commands are running #2214 (dev) and Deepen Fleet Run metrics source capture #2090 (thirdshift.app) each "Quota wait until 11:47 EST" for over an hour.
dev's ~/.thirdshift/github-quota.json held one wait: {resource: graphql, remaining: 4995, reset_at: 2026-11-12T16:46:42Z}. Live gh api rate_limit at the same time showed graphql 4973 remaining.
Cause (as of origin/main 5e573fe)
GitHub::record_quota_failure (src/github/quota.rs) runs after a request fails on a rate limit. It probes rate_limit, builds a Quota from whatever the probe returns, and calls Store::exhausted, which records it with waiting = true unconditionally (src/github/quota/store.rs). If the window has reset between the failed request and the probe, the probe returns a full quota and the next reset time. thirdshift then records "exhausted until the next reset" with 4995 left, and returns that reset to the caller.
Two places then trust it:
- Pass admission:
GitHub::pass_quota_waitreturns a known wait from the store without probing, so nothing clears the wrong wait until itsreset_atpasses.Store::observewould clear it, sinceQuota::lowis false at 4995, but admission never reaches the probe while a wait is stored. - Running Commands: the reset returned by
record_quota_failuregoes toquota::command::wait, which sleeps until it, so a Command waits a full window with a full quota.
Agent Brief
Category: bug
Summary: A Quota wait is recorded only when the quota really is low; a probe showing the reserve available never starts or extends a wait.
Current behavior:
After a rate-limited request, thirdshift records a Quota wait until the probed reset time even when the probe shows the quota already reset. Every Pass on the machine skips, and the failing Command sleeps, for up to an hour with a full quota.
Desired behavior:
- After a rate-limited request, thirdshift records a Quota wait only if the probed quota is low (below the reserve, with its reset in the future), or if the probe failed and it must assume exhaustion (today's 15-minute fallback stays).
- If the probe shows the reserve available, any stored wait for that account and resource is cleared, as an ordinary observation would. The failed request is retried promptly instead of sleeping to the next reset.
- A stored wait whose recorded
remainingis at or above the reserve is not treated as a wait by Pass admission or the Inbox. - The Inbox warning and Console text keep reporting real waits as today.
Key interfaces:
GitHub::record_quota_failureandGitHub::pass_quota_wait(src/github/quota.rs)Store::exhausted/Store::observe/Store::waiting(src/github/quota/store.rs)quota::command::wait(src/github/quota/command.rs)GLOSSARY.md: Quota wait
Acceptance criteria:
- A rate-limited request whose probe reports
remaining≥ 500 records no wait, and the Command retries without sleeping to the reset. - A rate-limited request whose probe reports
remaining< 500 with a future reset records a wait and the Command sleeps until it (unchanged). - A failed probe still records the fallback wait (unchanged).
- A store holding a wait with
remaining≥ 500 does not make Pass admission skip. - Existing quota tests pass.
Out of scope:
- Changing the 500-point reserve.
- The GitHub App migration (Authenticate the fleet as a GitHub App to raise its API quota #1993) and request reduction (Measure and cut the GitHub reads idle Passes make #1992).
Related: #1994, #1996, #1997 (the Quota wait Spec and its Tickets).
Activity
Model spent quotas in the probes of rate-limited test fixtures (#2128)