Expand description
Automatic failover (docs/specs/SPEC_AGENTS_OPERATE_OTHER_MACHINES_2026_10_30.md §4.4, D4):
an agent whose pane hit a usage limit moves itself to another signed-in account of its
provider that has quota, once its turn is over, and says so in one note to the agent and one
to its lead.
It is agent.account.switch (switch::switch_to, after_turn) chosen by srv, so the move
relinks, clears the old account’s limit and restarts the pane the way every other switch does.
It never picks:
- an account the operator marked “never fail over to this” (
context.never_failover); - an account that is not signed in (
valid/ok; an unchecked one is not trusted with an unattended move), or one a pane of another agent has just found out of quota; - an account of another provider.
agent:accountfailover (default on; false turns it all off) is the one setting.
Structs§
- Identity
Account SetFailover Req identity.account.set_failover.- Identity
Account SetFailover Result identity.account.set_failover: how the account stands now.
Constants§
- ACTOR 🔒
- Who the audit row names, and what tells
notifya switch was a failover. - ACTOR_
EXPIRED 🔒 - The same for the move off a login that expired (
login_expiry). - NEVER_
FAILOVER - The account’s mark (in
context): never move an agent onto it by itself. The account’s mark (incontext): never move an agent onto it by itself.server::account_episodes::failoverre-exports it. - SETTING
agent:accountfailover: move an agent that hit its limit to an account with quota. On unlessfalse.- UNKNOWN_
RESET_ 🔒MS - How long to avoid an account left over a limit with no known reset.
Statics§
- LEFT 🔒
- Accounts an agent was moved off after a limit, and when that limit lifts (unix ms): the move clears the stored failure, so without this the next failover could send the agent straight back to an account no pane has re-tested yet.
Functions§
- enabled 🔒
- is_
actor 🔒 - Whether
actoris one of the failovers (their moves are told to the agent and its lead). - is_
never - Whether the operator marked
a“never fail over to this”. - notify 🔒
- The one-line notes for a failover that landed: to the agent’s panes, and to its lead’s first
open pane. Held for each one’s next turn: neither is woken for it, and the agent’s pane is not
asked to run before its account is in place.
expiredsays the login ended, not the quota; the panes inwokenget their own note that starts a turn (login_expiry), so not this one. - recently_
left 🔒 - remember_
left 🔒 - run 🔒
- Move each agent with a pane out of quota (a usage limit, not a refused sign-in) to an account
that can run.
panesare the blocked panes of this refresh. An agent with a move already queued is left to it. BLOCKING (store reads, link writes, restarts). - set_
failover 🔒 identity.account.set_failover. BLOCKING (a store write).- target 🔒
- The account
pane’s agent moves to: one of its provider’s other accounts that is signed in, has quota, isn’t marked and wasn’t just left over its own limit, else why not.