Skip to main content

Module login_expiry

Module login_expiry 

Source
Expand description

A login that expired: its agents move to a valid login by themselves, and the one that was mid-turn carries on.

An account whose sign-in status is expired, needs_reauth or invalid can’t run an agent. The agents on it:

  • move to another valid login of the same account first (the same stable id, so the same plan and quota), else to another signed-in account of the provider that can run (never one marked “never fail over to this”; agent:accountfailover turns it all off), as agent.account.switch does, once their turn is over;
  • get one note that says so; one whose turn died on the expired login gets, as the note, a turn of its own: “your last step may not have finished: check git status and your PR first”, so it carries on instead of sitting idle (a compaction that failed on the login is a turn that compacts again on the new one);
  • are the person’s business once: one notification, and a row in the account strip with the sign-in action, until the login is signed in again.

Statics§

TOLD 🔒
The logins whose agents were moved off after they expired, with when: the person is told once for each, and the strip shows it until it is signed in again.

Functions§

agents_by_account 🔒
The open agents on each account, by the links their spawn resolves through (their own, or the seeded template’s an agent inherits).
choose 🔒
Where the agents of from go: a signed-in login of the same account (stable id) that nothing blocks, else another signed-in account of its provider that can run. blocked is account_blocks (an account a pane found out of quota or signed out); left says an account an agent was just moved off over its limit, which no pane has re-tested.
event_of 🔒
expired 🔒
Whether a sign-in status means the login can’t run an agent.
forget_signed_in 🔒
A login told about that is signed in again (or gone): its notice comes down and the strip row ends.
interrupted 🔒
Of blocks, the ones whose turn died on a refused sign-in: read before the move clears it.
lost 🔒
Whether the login is lost, not merely out of date. needs_reauth and invalid say the provider refused it. expired can be an access token the CLI refreshes by itself (a spawn stores it so), so it counts only once a pane’s run on it was refused: refused are the accounts of those panes.
notice_key 🔒
resume 🔒
Start the turn of each of block_ids (panes just restarted on to_label) with resume_note, once its agent has registered.
resume_note 🔒
What the agent whose turn was cut off is told, as the turn it starts.
rows 🔒
The strip’s rows for the logins told about that still need signing in: no agents (they moved), so the row offers the sign-in, not a move. Not for a login an open episode shows already.
run 🔒
Move the agents of each lost login. Runs with every episode refresh; panes are its blocked panes. BLOCKING.
tell_person 🔒
The notice: once per login until it is signed in again, never naming it (a notification can show on a locked screen); the strip row names it and has the sign-in action.