Skip to main content
POST /execute returns Server-Sent Events. The events fall into four families: lifecycle, content, tool calls, and human-in-the-loop. This page catalogs them. Each event has the shape:
A blank line terminates each event. The data payload’s exact shape depends on the event type.

Lifecycle

thread_lifecycle

Emitted at the start and end of every turn.
A turn always opens with a started event and closes with completed or errored.

error

Emitted when execution fails mid-stream. After this event, no more events will arrive on the current call.

Content

text_delta

A chunk of model output text. Concatenate all text_delta events in order to get the full response.

thinking_delta

A chunk of the model’s internal reasoning when extended thinking is on. Treat the same way as text_delta but render in a separate UI region (or hide entirely if you don’t surface thinking to users).

content_block_start / content_block_stop

Emitted around content blocks (text, thinking, tool use). Useful when you need to track block boundaries — for example, to emit a UI separator.

Tool execution

tool_call

The model has decided to call a tool. The input field contains whatever the model provided as arguments.

tool_result

The tool finished. output holds whatever the tool returned. May include an error field if the call failed.

Human-in-the-loop

hitl_request

The agent has paused and needs your answer. Reply with POST /hitl/respond using the request_id. Until you reply, the stream will continue to emit other events (heartbeats) but will not proceed.

hitl_resolved

Emitted after POST /hitl/respond to signal that the loop has resumed.

Memory and context

working_memory_update

Emitted when the agent writes to working memory.

compaction_event

Emitted when the compaction orchestrator collapses earlier turns.

Diagnostic

heartbeat

Periodic. Use to detect dead connections client-side.

usage

Token usage so far for the turn.

Notes for client implementers

  • Missing event: lines. Some clients omit the event: line and only send data:. The Engine always emits event:. Use it to route.
  • Reordering. Events are emitted in execution order. Don’t try to reorder them.
  • Multiple text streams. A single turn can emit text from multiple tool calls and thinking blocks. Use content_block_start / content_block_stop to separate them.
  • Disconnections. If your client disconnects mid-stream, use GET /execute/replay?after=<ts> to fetch missed events.

See also