Skip to main content
A Session is a private conversation with its own workspace, memory, settings, and sandbox. Fleet RLM persists Session state in PostgreSQL and workspace files on a Daytona Volume.

Domain model

Persistence

Fleet stores Sessions, Turns, memory, and Session settings in PostgreSQL. See Deploy with PostgreSQL.
  • A Turn’s intent is recorded before it runs, with status running. It ends as completed, failed, or cancelled.
  • A completed Turn commits its record, its learned note, and its outcome in one transaction. A dropped stream can’t undo a committed Turn.
  • Each Session keeps up to 200 Turns of history. Fleet passes the latest 8 Turns, capped at 16,000 characters, to the model as conversation history.
  • Mode, model, and context selections persist and survive a server restart.
History and Turn status are durable reads. GET /sessions/{session_id}/history and GET /sessions/{session_id}/turns/{turn_id} read PostgreSQL directly. They work during a Turn, from any server process, and without starting the Session’s sandbox.

Session runtime

The first request that needs a Session’s sandbox builds a runtime for it in the server process. The runtime holds the Session’s Daytona sandbox, Skill manager, and DSPy engine.
  • The server holds at most runtime.max_active_sessions runtimes. Requests for a new Session beyond that limit return 503.
  • DELETE /sessions/{session_id} stops the sandbox, releases the lease, and drops the runtime. History is kept, and the next request rebuilds the runtime.
  • Before each Turn, Fleet refreshes the sandbox state from Daytona. If Daytona stopped the sandbox while it was idle, Fleet restarts it and emits sandbox_resuming.

Session lease

Fleet holds a PostgreSQL advisory lock for each Session runtime. Only one server process can own a Session at a time. A second process that tries to build a runtime for it gets 503. Fleet checks the lease connection in the background. If the connection drops, Fleet takes the lock again on a fresh connection. If another process took the Session in the meantime, Fleet marks the lease as lost and cancels any running Turn. The next request evicts the stale runtime and rebuilds it once the draining Turn finishes.

Session lock

Each Session runs one Turn at a time. Turns, workspace writes, context, mode, model, memory changes, and Skill syncs share one lock. When a Turn holds it, those routes return 409 after 2 seconds. See HTTP API.

The workspace Volume

One Daytona Volume holds every Session’s workspace. Root sandboxes can also mount shared learned notes at /learned. See Configuration. Upload files with POST /sessions/{session_id}/attach or /attach in the terminal. Fleet stores them under files/ and reports their sandbox path, for example /workspace/files/report.csv.

Memory

Memory is scoped to a Session. You write and review it with the memory routes, and each committed Turn can add a learned note. Before each Turn, Fleet searches the Session’s memory for the task and passes only reviewed matches to the model. Set reviewed: true on a memory to make it Turn evidence.

Cancellation

Close the Turn stream to cancel it. Fleet requests remote cancellation, stops child sandboxes, and records the Turn as cancelled. The Session stays locked until the sandbox work has drained.
Last modified on October 20, 2026