POST /sessions/{session_id}/turn returns a text/event-stream response. Each frame has an id line with the event’s sequence number and a data line with one JSON envelope. The connection may also carry SSE comment keep-alives.
Envelope
Every event uses a version 1 envelope.
Fleet also copies the
payload fields to the top level of the envelope for compatibility.
Stream order
- The stream opens with
turn_status(phase: "preparation"). - Routing, Skill, sandbox, model, tool, and code events stream while the Turn runs.
- Fleet reports exactly one outcome event:
turn_complete,error, orturn_cancelled. - After sandbox cleanup, the stream ends with a
doneevent. It lets your client tell a clean finish from a dropped connection.
error event before it closes the stream. A client that reads until an outcome event never waits forever. Fleet sends no events except done after the outcome.
Events are live activity, not a durable log. Use GET /sessions/{session_id}/history or GET /sessions/{session_id}/turns/{turn_id} to read stored outcomes. See HTTP API.
Outcome events
Every outcome event also reports:
route is direct, flex, or rlm. lm_calls counts shared budget units across the whole agent tree, not only visible model requests. budget_breakdown splits them into generation_query, routing, skill_selection, and other_decisions.
A replayed Turn (same idempotency_key as a completed Turn) streams the stored outcome with the original turn_id.
Routing and Skill events
Model, module, and tool events
Model, module, and tool activity arrives as paired*_start and *_end events that share a call_id.
Every
*_end event reports ok, error_type, and duration_ms. DSPy callback events also include parent_call_id.
Sandbox and code events
Status and progress events
Status labels are advisory. They never cancel, pause, retry, or shorten a Turn.
Until the outcome event, every other event also carries the current
status label: