Components
Routes and modes
Each Turn runs through one route:
The Session mode decides how Fleet picks the route. In
hybrid mode, the default, a router selects direct, flex, or rlm for each Turn. A selected input file rules out direct, and routing errors fall back to rlm. In direct, flex, or rlm mode, Fleet uses that route directly. Explicit direct mode inlines the Session’s workspace files into its single prompt. See Reasoning and recursion.
The life of a Turn
A Turn is one user request in a Session.- Request. Your client sends
POST /sessions/{session_id}/turnwith ataskand an optionalidempotency_key. The server opens an SSE stream. - Lock. One Turn runs per Session at a time. If another Turn or a workspace change holds the Session lock for more than 2 seconds, the server answers
409before the stream starts. - Prepare. Fleet refreshes the sandbox, restarting it if Daytona stopped it while idle. It syncs Skills and gathers file digests and memory for the Turn.
- Route and execute. The engine picks a route. Generated Python runs in the Daytona sandbox and calls back to Fleet for host tools. Child agents run in their own sandboxes within shared limits.
- Commit. Fleet commits the Turn to PostgreSQL. Committing is idempotent per Turn, so a connection retry can’t store a Turn twice.
- Report. The stream always ends with exactly one outcome event:
turn_complete,error, orturn_cancelled. The server then releases the Session lock.
Where state lives
- Turn history lives in PostgreSQL. You can read history and Turn status even when no runtime is active for the Session.
- The workspace holds
files,artifacts,memory,skills,buffers, andsessionsareas on a per-Session Daytona Volume subpath. - Session selections such as mode, selected context, and root and sub models persist across restarts.
- Python variables in the sandbox are not durable state.
Runtime policy
Non-secret defaults live inconfig/fleet.toml. Credentials and DSNs come only from .env or the environment. Precedence is built-in defaults, then TOML, .env, the process environment, and explicit overrides such as CLI flags. See the configuration reference.