Skip to main content
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. Event fields live only in payload. Fleet no longer copies them to the top level of the envelope, so read them from payload. The envelope has no fields besides the ones above.

Stream order

  1. The stream opens with turn_status (phase: "preparation").
  2. Routing, Skill, sandbox, model, tool, and code events stream while the Turn runs.
  3. Fleet reports exactly one outcome event: turn_complete, error, or turn_cancelled.
  4. After sandbox cleanup, the stream ends with a done event. It lets your client tell a clean finish from a dropped connection.
If the Turn stops without reporting an outcome, Fleet sends a sanitized 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. Activity events are best effort. When your client reads slowly, Fleet drops or coalesces nonterminal events instead of slowing the Turn, so either half of a *_start and *_end pair can be missing. Outcome events (turn_complete, error, turn_cancelled) and done wait up to 30 seconds for space in the stream. If you miss an outcome, read it with GET /sessions/{session_id}/turns/{turn_id}. 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, other_decisions, and web_search (host web_search calls that reached a configured provider). The values add up to lm_calls. 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

Fleet RLM no longer derives an advisory status label. It removed the status event, the status field that earlier versions added to every event before the outcome, and the sandbox progress events.

Example

Last modified on November 19, 2026