Repository navigation
Closed
Closed
Copy link
Labels
Description
Parent
What to build
The per-machine Quota wait record and the module every GitHub caller uses to read it, with the Inbox moved onto it. After this Ticket, nothing about Passes or running Commands changes yet, but the machine has one view of GitHub's quota.
- One record per machine, keyed by GitHub host, authenticated user login and resource (REST core, GraphQL), holding the reset time and last observed remaining count. No token or secret stored. Atomic writes; entries whose reset has passed are ignored.
- Ways to learn a Quota wait: from a thirdshift GitHub call failing with primary-quota diagnostics (then reading
gh api rate_limitfor the reset time, or assuming 15 minutes ahead when none can be read), and from a quota check that finds a resource below the fixed reserve of 500. - The wait calculation the later Tickets use: reset + 1 minute + a random 0–60 seconds, and a per-Command running total checked against a 2-hour cap. The clock and random source can be injected for tests.
- The Inbox's existing quota pause reads and writes this record instead of its own, with no visible change in Inbox behaviour.
GLOSSARY.mdgains Quota wait: the time until GitHub's quota for a GitHub user resets, during which Passes are skipped and running Commands wait instead of failing. Define it without implementation detail.
Acceptance criteria
- A primary-quota failure from thirdshift's GitHub adapter records a Quota wait for the right host, user and resource, with the reset time from
gh api rate_limit. - With no readable reset time, the Quota wait ends 15 minutes ahead.
- Different GitHub users, GitHub hosts and resources never share a Quota wait.
- An entry whose reset has passed does not count as a Quota wait.
- Concurrent writers on one machine cannot corrupt the record.
- The wait calculation returns reset + 1 minute + 0–60 seconds, and reports when a Command's total would pass 2 hours; unit tests use an injected clock and random source.
- The Inbox's existing quota tests pass on the shared record, and the Inbox behaves as before.
-
GLOSSARY.mddefines Quota wait. -
scripts/affected-tests mainpasses.
Activity
JacobStephens2 commentedon Nov 11, 2026
Closed by #2001, merged into issue-1994 by a thirdshift Ticket run with Self-merge.