You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Account selection for antigravity and apikey credentials: planned, or must callers pin auth.account? #3
Is account selection or fallback planned for antigravity and apikey credentials? Or is the design that a caller must pin auth.account on each send and do its own fallback?
Only oauth and chatgpt credentials ask the routing module for an account (selects_accounts, crates/broca-module-serve/src/account_routing.rs:555-557; module doc at :6-19).
For all other methods, a run uses one static credential id per method and provider (resolve_credential_id, crates/broca-module-serve/src/auth_routing.rs:218).
A caller can name an account with auth: {method, account} on the send (crates/broca-wire/src/lib.rs:239, :783-789). broca uses the pin only on a fresh episode (crates/broca-module-serve/src/main.rs:1352).
Effect
An antigravity login is a subscription account, the same as an oauth login. A host can have grants on more than one Antigravity account. If the static account answers 429 RESOURCE_EXHAUSTED, the run ends with an error. broca does not try the other granted accounts. A host-side Antigravity client that rotates accounts can complete the same request.
The same is true for apikey credentials when a provider has more than one key.
What would help
If selection or fallback for these methods is planned, a short note on the plan.
If the design is that callers pin auth.account and do their own fallback, please add that to the module-surface documentation, so that a caller knows that it must move to the next account after a 429.
Thanks, the reading of the code is accurate for today. We've since settled how account choice works, so here's that design.
broca never chooses an account on its own logic. A routing module chooses, and broca carries out its answer.
Every credential kind is a pool. For every provider with credentials, including antigravity logins and apikey keys, the routing module picks the account for each run. Today only the oauth and chatgpt subscription methods work this way.
When broca asks. It asks when a run starts, and again when a step is refused because the account is out of quota.
Hold or move. If the limit that blocks the account resets soon, routing answers "wait" and the run keeps its account, which keeps the prompt cache. At the start of a run broca then refuses the send with the time to retry. Inside a run it pauses and resumes at that time. Otherwise routing names another account.
Switching inside a run. broca continues the same run on the new account, as long as it's the same kind of credential. It never switches kinds, for example from a subscription to an API key, because that changes the request itself. The switch is recorded in the session log, and the switched step misses the prompt cache, since the cache belongs to the old account.
Blocks lift on evidence. An account becomes usable again as soon as a fresh quota reading shows room, not only at a predicted reset time.
Without a routing module, broca still never chooses. The caller names the account with auth: {method, account}, and when that account runs out the run ends account_limit_exhausted, naming the credential and, where the provider gives one, the reset time.
This isn't built yet. We'll update docs/module-surface.md when it ships, so a caller knows exactly what to send in each case.
Activity
broca-alfonso commentedon Oct 24, 2026
Thanks, the reading of the code is accurate for today. We've since settled how account choice works, so here's that design.
broca never chooses an account on its own logic. A routing module chooses, and broca carries out its answer.
antigravitylogins andapikeykeys, the routing module picks the account for each run. Today only theoauthandchatgptsubscription methods work this way.auth: {method, account}, and when that account runs out the run endsaccount_limit_exhausted, naming the credential and, where the provider gives one, the reset time.This isn't built yet. We'll update
docs/module-surface.mdwhen it ships, so a caller knows exactly what to send in each case.