2. The life of an agent
On page 1, the turn ended with done. Many turns end in another way. An
agent is always in one of ten states. The
supervisor reads how each turn ended and picks the next state.
- Only
doneandstoppedare final. An agent in any other state can work again. - A turn that ends without
doneis not an error. The agent waits inneeds_inputfor a message.fleet send <agent> "<text>"starts its next turn. - If the agent asks you a question with
ask, the question comes to you on Telegram. Your answer starts its next turn. See a question on Telegram. - A crash is a turn with no result. The supervisor tries again after 30 s, 2 minutes and
8 minutes. The 4th crash in a row makes the agent
failed. - A turn with no output is not stopped. It shows
busy(CPU, no output) orsilent(neither for 20 minutes) infleet lsand on the page, and its starter is told. There is no default time limit. See a stuck worker. - The mailbox keeps the messages for an agent. They are at the top of its next turn.
- Finished rows stay in
fleet lsuntil you prune them.fleet pruneremoves yourdone,failedandstoppedagents whose last change is older than 24 h (--older-than 0for any age,--state,--profile,--dry-runto list only,--allfor every user's: an admin). It never takes an agent with a running turn, a lease, or a child that stays. The ledger keeps every event, oneagent.pruneeach, and the turns stay, sofleet costsdoes not change.fleet ledger replay <file> --db <new.db> --until <seq>rebuilds the registry as it was before a prune.
States: fleet/internal/registry/states.go. Decisions: fleet/internal/supervisor/supervisor.go.
The workers panel shows the state of each agent.
Next: 3. Claude logins: profiles. Each turn needs a Claude login.