Quota #
The daemon polls supported accounts for provider-reported quota readings. These
readings are separate from the token usage recorded for
provider requests.
quota.gleam owns discovery, scheduling,
storage, and queries.
Accounts #
enumerate collects eligible Claude, Codex, Google Antigravity, OpenCode Go,
and profile targets. A target includes a provider, a non-secret account label,
and credentials for the fetch. Discovery and individual polls run outside the
poller actor. See
enumerate and start_due and
authentication.
Cadence #
The quota section of extensions.json defaults to enabled: true,
pollSeconds: 600, and busyPollSeconds: 120. The poller reloads settings each
round. It clamps the ordinary interval to 1 through 86,400 seconds and the busy
interval to 1 through the ordinary interval.
A successful report uses the busy interval if a limit is at least 80 percent
used or resets within the next 15 minutes. Failed polls use exponential backoff
based on the ordinary interval, with the exponent capped at six and the wait
capped at one hour. See
load_settings, wait_seconds, and is_busy.
Readings #
record stores one row per reported limit, or an error row with an empty limit
ID when a report has no limits. Every returned Antigravity report also updates
account limit marks through heal_antigravity, including reports with an error
or no limits. Empty reports prune expired marks and remove integer legacy global
marks. The
account policy
owns reconciliation; the native adapter retains matching, locking, storage
layout, and unknown fields. An omitted meter keeps its live mark. The recorded
reading is the provider report, not an independently measured balance. See
run and record.
Reading them back #
latest returns the latest row for each
account, provider, and limit. It suppresses an empty-limit error row after a
newer real limit reading for that account and provider. history returns
newest-first rows with an ID cursor and can filter a provider, account, and
limit trail. The daemon server exposes
these queries through its HTTP API.