Skip to main content
Fleet Prime Agent streams every turn as structured events instead of returning a single blob at the end. That’s what makes the web UI feel live and what lets scripts react to progress before a turn finishes.

What you see in a turn

A typical turn produces:
  1. start — the turn began.
  2. thinking (only for reasoning models) — the model’s plan or reasoning trace.
  3. delta — streaming assistant text, one chunk at a time.
  4. tool — one card per tool call, updated as the tool runs.
  5. state — session state changed (branch, resume, compaction).
  6. done — turn finished. Errors arrive here or as an error event.
For the full event list see Streaming protocol.

Consuming the stream

In the web app: the browser subscribes to NDJSON over an HTTP route (web/app/src/routes/api/). The BEUI renderer in web/design turns each event into a card. From the CLI: run in json mode to get one JSON object per line on stdout, or rpc mode for a JSON-RPC framing:
Pipe the output into jq for a quick shell UI:
From your own code: attach to the daemon with DaemonClient and subscribe to AgentSessionEvent. See Daemon.

Partial messages

The runtime emits message_update events carrying the growing streamingMessage as the model streams tokens. On message_end you get the final AgentMessage. Render the partial one until the final one arrives.

Errors are events

The stream never throws mid-turn. Failures arrive as done (with an error status) or as an explicit error event. Clients don’t need to distinguish between transport and agent errors — both are on the same channel.
Last modified on August 17, 2026