09 / API budget

Many agents on one repository, one GitHub quota

Many agents on one repository exhaust GitHub's API limits, mostly by polling CI, reviews and the merge queue. BareCI already receives every webhook, so it answers those questions itself, and an agent that waits for a change costs GitHub nothing.

terminal
bareci ready --wait   # holds until nothing is pending

How it works

Wait, don't poll

bareci ready --wait and the wait MCP tool hold until the pull request changes: a check finishes, a review lands, the Gate turns green or the queue moves.

Reads from BareCI's copy

Readiness, findings, checks, runs and queue position come from BareCI's state, kept current by webhooks and reconciled on a schedule.

BareCI's own calls, budgeted

One budget per installation, fed by GitHub's rate-limit headers: conditional requests, batched reads, coalesced duplicates, and backoff on limits. Gate and queue calls go first.

Less CI churn

Runs for a superseded head are cancelled, only affected tests run, and the Gate runs before a pull request enters the merge queue, so queue runs rarely fail and retry.

Later The API budget is being built now; wait, per-agent usage and the call budget arrive together.

Questions

Why does polling matter?

Every agent that polls GitHub for check or review status spends the same installation's API quota. With many agents on one repository, polling alone can exhaust it.