Fleet docs v0.2.0-rc.448

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 done and stopped are final. An agent in any other state can work again.
  • A turn that ends without done is not an error. The agent waits in needs_input for 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) or silent (neither for 20 minutes) in fleet ls and 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 ls until you prune them. fleet prune removes your done, failed and stopped agents whose last change is older than 24 h (--older-than 0 for any age, --state, --profile, --dry-run to list only, --all for 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, one agent.prune each, and the turns stay, so fleet costs does 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.