Expand description
One notice per account episode, and the move to another account
(docs/specs/SPEC_UNRESPONSIVE_AGENTS_2026_10_23.md §6).
An episode is every agent pane that is limited or signed_out on one
account (agent_state::unavailable_of_block, which reads the account its
run launched on through run_accounts_of_block), from the first until none
is: the reset passed, the agents moved, or they recovered. srv keeps them
in memory (machine::Episodes) and rebuilds them from block meta on
start; a failure stored before the start is the episode rebuilt, not news.
What follows from an episode:
- the
accountavailabilityevent when it opens, changes or closes (ok), andidentity.account.availabilityfor the open ones, which the Kanban and Swarm strips show with the move action; - one OS toast (
NotifyKind::AccountUnavailable) for a sign-in problem or a weekly (or unknown) limit, never for a session limit, and no per-paneAgentCrashedor “finished” toast for a pane it covers (covers_block); - one
[AgentMux]note to the agent that requested each task a newly blocked agent holds. A worker’s leader already hears frombackend::worker_notes.
An agent that hits a usage limit moves by itself to an account with quota after its turn
(failover); so do the agents of a login that expired, to a valid login of the same account
first, and the one that was mid-turn carries on (login_expiry).
identity.account.move_agents (moves) links an episode’s idle agents
to another signed-in account of the same provider and restarts their
panes; any link change clears the failure its old account caused
(failed_panes, after_rebind), and a sign-in that proves an
account works clears its panes’ “signed out” (after_sign_in).
Modules§
- accounts 🔒
identity.accounts: the signed-in accounts on this machine as an agent sees them, and howidentity.switchnames one (docs/specs/SPEC_AGENTS_OPERATE_OTHER_MACHINES_2026_10_30.md§4.3, §4.4).- failover
- 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. - fresh 🔒
- The sign-in of each account as its credentials file says now, not as the store last recorded it.
- key_
account 🔒 - An Anthropic API key as an account a Claude agent can be moved onto
(
docs/specs/SPEC_AGENT_PANE_API_KEY_ACCOUNT_SWITCH_2026_11_16.md). - login_
expiry 🔒 - A login that expired: its agents move to a valid login by themselves, and the one that was mid-turn carries on.
- login_
recheck 🔒 - A pane left signed out by a login that has since been signed in again clears itself (#47468).
- machine 🔒
- The account episodes, as a pure state machine: a scan’s blocked panes in,
what to publish, raise and tell out
(
docs/specs/SPEC_UNRESPONSIVE_AGENTS_2026_10_23.md§6.1, §6.2). No clock, no store:mod.rsscans and applies. - moves 🔒
- “Move these agents to another signed-in account”
(
docs/specs/SPEC_UNRESPONSIVE_AGENTS_2026_10_23.md§6.3):agent.account.switch(switch::switch_to) for each agent of the episode, so an agent in a turn is queued. - resume 🔒
- After a confirmed sign-in, an agent whose last turn failed on the expired login is told, and answers with where it stands (task #2458).
- switch 🔒
agent.account.switch: change which account an agent runs on (docs/specs/SPEC_ACCOUNT_SWITCH_FROM_THE_COMPOSER_NO_BIND_2026_10_26.md§3.1, §3.2, §3.4).- switch_
error 🔒 - Why an account switch did not happen: what went wrong, for code, and the words the caller reads.
Structs§
- Account
Availability - One account’s episode, as
identity.account.availabilitylists it for the operator’s windows and for agents. The label never goes in a toast or an event; it reaches another machine only through the provenidentity.accountsremote operation. - Account
Availability Event accountavailability(spec §6.1): an episode opened, changed or closed (ok). A signal for the windows, which then readidentity.account.availability: it carries no account label and no move candidates, since any connection can subscribe to an event.- Account
Episode Agent - One agent of an episode.
- Account
Episode Task - A Kanban task an episode’s agent holds (claimed, or blocked on a question).
- Account
Move Candidate - An account the agents can move to.
- Identity
Account Availability Result identity.account.availability: the open episodes. Open to agents (spec §4.4): it names accounts and their limits, never a credential.- Identity
Account Signed InReq identity.account.signed_in: the window’s sign-in to this account completed and its CLI confirmed the credential (#2237).- Identity
Account Signed InResult identity.account.signed_in: how many of the account’s panes stopped being signed out.- Runtime 🔒
Constants§
- SETTLE 🔒
- After a failure or a turn end, how long to wait for the other to land.
- TICK 🔒
- How often the episodes are rebuilt without a prompt: a reset passing changes them with no event.
Statics§
- RUNTIME 🔒
Functions§
- after_
clearing 🔒 - Failures were cleared: replay what was held for those agents, and let the episodes see that their panes left.
- after_
rebind - An agent was linked to
account_id(spec §6.3, “on rebind”): clear the stored failure of each ofbefore(failed_panes) whose run wasn’t on that account, then wake held messages and the episodes. Returns how many were cleared. - after_
rebind_ telling after_rebind, and withtellset the agents whose last turn failed on the old login are told they are signed in (resume::start). Set it only when the new login is known to work: a move to an account the choice found valid, or a key that just passed its check. Not for an unlink (no account at all) or a key nobody has checked, whose next turn could fail again.- after_
sign_ in account_id’s credentials were just proven good: a sign-in to it completed, or a validate of it passed (#2237). A rebind to the same account clears nothing (after_rebind), so without this its panes stayed signed out until a turn ran. A token refresh isn’t a proof and doesn’t call this. Runs off the async workers; does nothing beforeinstall.- agent_
name 🔒 - announce 🔒
- apply 🔒
- availability 🔒
- The open episodes, as the strips show them. BLOCKING.
- baseline 🔒
- The failures already stored when srv starts, whether or not their panes have a controller yet.
- blocking_
failure 🔒 - The failure kinds an episode is made of: a usage limit or a refused sign-in.
- canonical 🔒
pcanonical, or as given when it isn’t a known provider.- clear_
signed_ 🔒out - Clear the refused sign-in stored on each pane whose run was on
account_id, then wake held messages and the episodes. A usage limit stays: it ends at the reset or a move. Returns how many were cleared. BLOCKING. - clear_
signed_ 🔒out_ panes clear_signed_out, returning the panes it cleared with when their turn failed, forresume::start, which tells those agents. BLOCKING.- covers 🔒
covers_blockagainst these stores atnow_ms.- covers_
block - Whether an account episode speaks for this pane’s failure, so its own
AgentCrashedor “finished” toast is left out (spec §6.2): its stored failure is a usage limit that hasn’t reset or a refused sign-in, on an account. A pane with no account keeps its own toast. BLOCKING. - failed_
panes agent_id’s panes forproviderwhose stored failure is a usage limit or a refused sign-in, with the accounts their runs count against. Read before a link changes: a pane from beforeagent:run_accountcounts against the agent’s links, which the change replaces.- held_
tasks 🔒 - The claimed or blocked tasks each of
block_idsholds, by block, and who requested each one. - identity_
accounts 🔒 identity.accounts: every signed-in account here with its stable id and quota. Runs off the async workers.- install
- Start following the episodes. Call once at startup.
- label_
of 🔒 - membership 🔒
- The pane’s account and state while its stored failure keeps it in an
episode: a usage limit whose reset (if known) hasn’t passed, or a refused
sign-in, on an account. Read from the stored failure, not the live state:
a retry turn shows the pane
workingfor a moment, and that must not close its episode and open a new one with a second toast when the turn fails again. Only a clean turn, a rebind or the reset clears it. - panes_
of 🔒 - The panes (open, or parked) an agent’s definition has: what a change to the agent’s runtime is written to.
- publish 🔒
- rebind_
clearing 🔒 after_rebind_tellingwithout the telling: how many failures were cleared, and the panes among them (withtellset) whose last turn failed on the login, for the caller to pass toresume::startonce the pane is running on the new account. A move restarts its panes after the relink, so telling at the relink would reach the old process, still on the expired login.- refresh 🔒
- Rebuild the episodes now and act on what changed. BLOCKING (store reads).
- refresh_
soon 🔒 - Rebuild the episodes soon (a failure, a turn end, a rebind).
- register
- These RPCs are the operator’s, except
agent.account.switchandidentity.account.availability: an agent connection (bus:register) is refused for the others, since the move relinks and restarts other agents and a sign-in clears other agents’ state. A switch is open to agents (the caller isctx.agent_id) and is audited under their name. The availability names accounts and their limits, never a credential, and an agent has to see it to choose where to move (spec §4.4). - requester_
items 🔒 - For each requester of a task the newly blocked
paneshold: the panes, and the refs of that requester’s tasks each one holds. - requester_
notes 🔒 - The notes to send for the newly blocked
panesofaccount_id’s episode: one per requester per episode (spec §6.2), naming each of its agents and tasks. A requester already told in this episode gets nothing more when another agent joins: the strip shows the rest. - restart_
panes_ 🔒of - Restarts every open pane of the agent with its conversation resumed. A persistent pane in a turn is restarted when the turn ends. A one-shot (subprocess) pane, a container agent’s, is not restarted: a restart would end the turn it is in, and its next turn reads the agent’s choice anyway; nor is a stopped agent, which would be started by it. Those are counted apart. Returns how many were restarted, how many pick the change up at their next turn, and why the others were not restarted.
- scan 🔒
- Every agent pane whose stored failure puts it in an account’s episode now.
- signature 🔒
- switch_
account 🔒 agent.account.switchfor a caller that is not on the RPC engine (theIdentitytool’s HTTP route).calleris the agent’s slug. Runs off the async workers.- switch_
all_ 🔒limited Identityswitchwith the agentall limited.calleris the agent’s slug. Runs off the async workers.- tab_
blocks 🔒 - Every pane in a tab, and every parked agent block: one in no tab whose agent keeps running with no pane showing it. Its limit or sign-in refusal is as much an episode as a shown pane’s.
- toast_
key 🔒 - The toast’s key for an account: its group, and the id it is taken down by. Hashed, so the account id isn’t in the notification.
- view 🔒
- What the strips and the event show for
ep.