Login resource
What it is for #
A Login records whether one harness's login works on one place. An agent CLI needs a login to its vendor. When the login ends or stops working, every turn of every session of that harness on that place fails. A Login turns that into one incident:
- The Tasks that the login stopped show
attention. - No new session of that harness starts on that place, and no message is typed into one.
- One alert goes to people, and one reply when the login works again.
- Each Task that the login stopped gets one note to continue.
The agent-specific part is the harness profile's [login] plug
(profile format). The Login and its
controller are the same for every agent.
When you write one #
Never. The manager creates one Login for each harness and place that a Task
uses, when the harness profile has a [login] plug. fleet apply refuses
a Login.
Example #
The Login that the manager creates for Claude Code on this machine:
{
"apiVersion": "fleet/v1alpha1",
"kind": "Login",
"metadata": {"name": "claude.local"},
"spec": {"harness": "claude", "host": "local"}
}
fleet apply refuses this manifest. Read it with
fleet get login claude.local.
Spec #
The manager writes the spec, by exclusive creation. It is fixed once created.
| Field | Type | Required | Meaning |
|---|---|---|---|
harness |
string | yes | The harness profile's name. An alias, such as claude-code, gives the profile's name, claude. |
host |
string | yes | The place, <runtime>/<place> or local. |
The name is <harness>.<host>. When the harness or the place holds a
character that is not a lowercase letter or a digit, each such character
becomes -, and the name ends with - and 8 characters of a digest of the
exact pair. So mux/a.b and mux/a-b get different Logins. Fleet reads a
Login only when its spec names the Task's exact pair.
Status #
LoginController writes every field.
| Field | Meaning |
|---|---|
checked |
The last login check: {at, answer, endsAt, why}. answer is loggedIn, loggedOut or blind. endsAt is the latest time the login ends, when the check reports one. |
blind |
{since, runs, told} while the check's answer cannot be read: the runs in a row, and whether people were told. |
probedAt |
When the recovery request last ran. |
provenAt |
When a recovery request, or a check for a plug with no request, last proved that the login works. |
incident |
The open incident: {id, openedAt, reason, tasks}. reason.kind is turnFailed (with error and task), loggedOut or expired (with at). tasks lists the Tasks the incident stopped. |
closed |
The last closed incident: {id, at, tasks}. |
incidents |
The number of incidents opened. Each incident's id is its number. |
warnedFor |
The endsAt of the last warning that the login ends soon. |
posts |
Each message to people by its key: its text, its intent, its receipt, its attempts, the message the platform gave it, and the thread it opened. At most 16 delivered posts are kept. The alert and the reply of the open and of the last closed incident are always kept, and so is each post that a kept post replies to. |
notBefore |
The earliest next pass. |
conditions |
LoggedIn, Works and Notified, as the controller defines them. |
A Task records its side in its own status, written by TaskController:
| Task field | Meaning |
|---|---|
loginFailed |
{error, at} while the agent's last report is a turn that failed on its login. |
loginNudged |
The incident whose note to continue the Task was owed. |
condition LoginHeld |
True while the Login has an open incident and the Task has work to start or to send. Unknown with LoginUnreadable while the Login cannot be read: the spawn waits 1 s and tries again. |
Lifecycle #
A Login has no phases. Its incident is the state to read:
- Before a Task's first spawn, the manager creates its Login if it is missing and runs the Login's first check, in the same pass. A Task that takes its harness or place from a TaskConfig gets the check of the pair it resolved.
- A turn fails on an error type that the plug lists, or the check finds no login, or the check reports an end time in the past. The incident opens, and its alert is posted.
- While it is open, each Task of that harness on that place holds its
spawn, its brief, its inbox and its notes, with
LoginHeld=True. - Every 5 minutes, the check runs. When it reads a login, the recovery request runs. Only a request that exits 0 closes the incident.
- The reply to the alert lists the Tasks the incident stopped. Each one gets one note to continue.
A failure within an hour of a close opens the same incident again, with no new alert. The Login is deleted when no Task uses it, no incident is open and every post is delivered. The manager creates it again when a Task uses the harness on that place.
Related kinds #
- Each Task of the harness on the place reads the Login and holds its work while an incident is open.
- The Gateway controller owns the accounts and routes the alert is posted through.
- The Login controller owns the rules.
Commands #
fleet get login claude.local
fleet list login