Architecture
The states an agent moves through, and what survives sleep, crashes, and deploys.
States
An agent is idle until a prompt starts a run, and goes back to idle when the run ends or is cancelled. When the context fills up during a run, the agent compacts it and keeps going. Tool calls run in the sandbox.
Sleep
An idle agent sleeps and frees its memory. The next action on its key wakes it: the agent reloads its session and reconnects to the same sandbox, so clients don’t do anything different. While the agent sleeps, an E2B or Daytona sandbox is suspended, and an agentOS VM sleeps on its own.
What survives
| Session | Sandbox | |
|---|---|---|
| Sleep | Every message so far. | Reconnected on wake. |
| Crash | Every message written before the crash. | Reconnected on wake. |
| Deploy | Every message so far. Old Actors get up to 30 minutes to finish before the agent wakes on the new code. See Versions. | Reconnected on wake. |
| Destroy | Deleted. | E2B and Daytona sandboxes are deleted. An agentOS VM and its files are left in place. |
A model chosen with setModel is restored too, if it’s still allowed. If the sandbox no longer exists when the agent wakes, a new one is created and the old files are lost.