Documentation
¶
Overview ¶
Command ratewait blocks until the GitHub budget a caller names is at or above a threshold it states, and exits 0 only then.
⛔ WHY THIS EXISTS, and it is not convenience. The hourly budget is PER USER and roughly twenty-five sessions share it, so a write program meets a 403 it did nothing to cause. fleet.Throttled answers false for "API rate limit exceeded" on purpose -- "that budget will not refill inside any backoff this package would sleep" -- so the fleet's retry policy correctly gives up at once, and that leaves nobody able to WAIT. Measured 2026-11-15: the budget was spent at 13:52 and again at 22:06 CET; both times the only fleet-legal way to come back at the reset was a shell until-loop, which the shell-loop guard refuses, or a blind sleep, which is a guess about somebody else's traffic.
⛔ IT SLEEPS TO THE RESET THE API REPORTS, not on an interval. A poll loop spends the budget it is waiting for; the reset is a fact GitHub hands over with every reading, and rate_limit itself costs nothing.
⚠ IT IS BLIND TO THE SECONDARY LIMIT AND SAYS SO ON EVERY SUCCESS. That is not modesty, it is internal/fleet/budget.go's measurement: on 2026-10-10 gh answered 403 on every call while rate_limit reported 5000/5000 remaining. A tool that printed "the budget is fine" and stopped there would read as "safe to call" in exactly the case where it is not.