Event reference
ReferenceGenerated from source
Built-in public protocol and contract events, with their payload schemas. See JSON event stream and Services and events for usage.
This page is generated from the code by
scripts/gen_docs.py. Do not edit it by hand.
Protocol version: 3.0
turn/started
Section titled “turn/started”Agent turn started.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
turn_id |
string |
yes | |
trigger |
string |
yes | |
input_item_ids |
string[] | null |
||
text |
string | null |
||
source |
string | null |
||
truncated |
boolean | null |
Example
{ "turn_id": "t-1", "trigger": "prompt"}turn/completed
Section titled “turn/completed”Agent turn completed after run-end durability confirmation.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
turn_id |
string |
yes | |
status |
TurnStatus |
yes | |
termination_reason |
AgentTerminationReason | null |
||
cancellation_cause |
CancellationCause | null |
Origin of cancellation when termination_reason is interrupted. |
|
text |
string | null |
||
structured |
any |
||
usage |
object | null |
||
error |
EventError | null |
||
error_kind |
string | null |
||
not_sent |
boolean | null |
||
truncated |
boolean | null |
Example
{ "turn_id": "t-1", "status": "completed", "usage": {}}step/started
Section titled “step/started”Model step started within a turn.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
turn_id |
string |
yes | |
step_id |
string |
yes | |
turn |
integer | null |
||
model |
any |
||
attempt |
integer | null |
||
truncated |
boolean | null |
Example
{ "turn_id": "t-1", "step_id": "s-1", "turn": 1, "attempt": 0}step/completed
Section titled “step/completed”Model step finished (completed, failed, or retrying).
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
turn_id |
string |
yes | |
step_id |
string |
yes | |
status |
StepStatus |
yes | |
stop_reason |
string | null |
||
usage |
any |
||
error |
EventError | null |
||
error_kind |
string | null |
||
will_retry |
boolean | null |
||
attempt |
integer | null |
||
delay_ms |
number | null |
||
reset |
boolean | null |
||
truncated |
boolean | null |
Example
{ "turn_id": "t-1", "step_id": "s-1", "status": "completed", "will_retry": false}item/started
Section titled “item/started”Semantic item (message, tool call, custom record, or compaction) started. Oversized wire payloads are bounded at the outbound tap (truncated: true on truncated items/blocks; fetch full content via session.get_item).
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
turn_id |
string | null |
||
item_id |
string |
yes | |
step_id |
string | null |
||
item |
Item |
yes |
Example
{ "turn_id": "t-1", "item_id": "it-1", "item": { "type": "assistant_message" }}item/delta
Section titled “item/delta”Append-only incremental delta for an in-flight item.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
yes | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
turn_id |
string |
yes | |
item_id |
string |
yes | |
kind |
ItemDeltaKind |
yes | |
delta |
string |
yes | |
offset |
integer ≥ 0 |
yes | |
tool_call_id |
string | null |
||
partial |
any |
||
event |
any |
||
truncated |
boolean | null |
Example
{ "turn_id": "t-1", "item_id": "it-1", "kind": "text", "delta": "hi", "offset": 0}item/completed
Section titled “item/completed”Authoritative completed item. For tool_call, item.message is the sole carrier of content/details. Oversized wire payloads project images to { type: "image", mime, path?, bytes, truncated: true }, truncate long strings with truncated: true, or fall back to item_omitted: true; fetch full content via session.get_item.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
turn_id |
string | null |
||
item_id |
string |
yes | |
status |
ItemStatus |
yes | |
item |
Item | null |
||
item_omitted |
boolean | null |
Example
{ "turn_id": "t-1", "item_id": "c-1", "status": "completed", "item": { "type": "tool_call", "tool_call_id": "c-1", "name": "read", "status": "completed", "message": { "role": "tool_result", "tool_call_id": "c-1", "tool_name": "read", "content": [], "is_error": false }, "result_status": "success", "execution_status": "unknown" }}queue/changed
Section titled “queue/changed”Agent steer/follow-up queue snapshot changed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
items |
QueueItem[] |
yes | |
action |
string | null |
||
truncated |
boolean | null |
True when the outbound event tap truncated strings or projected images to stay within EVENT_MAX_BYTES. |
Example
{ "items": [ { "input_id": "q-1", "lane": "steer", "text": "stop" } ]}host/notice
Section titled “host/notice”Informational or warning notice from the agent or host.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
yes | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
level |
string |
yes | |
text |
string |
yes | |
truncated |
boolean | null |
True when the outbound event tap truncated strings or projected images to stay within EVENT_MAX_BYTES. |
Example
{ "level": "info", "text": "ok"}subagent
Section titled “subagent”subagent/started
Section titled “subagent/started”Subagent run started.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
subagent_id |
string |
yes | |
agent_id |
string | null |
||
name |
string | null |
||
label |
string | null |
||
run_id |
string | null |
||
seq |
integer | null |
||
task |
string | null |
||
parent_session_id |
string | null |
||
parent_session_epoch |
string | null |
||
truncated |
boolean | null |
True when the outbound event tap truncated strings or projected images to stay within EVENT_MAX_BYTES. |
Example
{ "subagent_id": "child-1", "parent_session_id": "parent-1"}subagent/progress
Section titled “subagent/progress”Latest coalesced progress snapshot for a subagent.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
yes | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
subagent_id |
string |
yes | |
parent_session_id |
string | null |
||
parent_session_epoch |
string | null |
||
progress |
object |
yes | |
truncated |
boolean | null |
True when the outbound event tap truncated strings or projected images to stay within EVENT_MAX_BYTES. |
Example
{ "subagent_id": "child-1", "parent_session_id": "parent-1", "progress": { "state": "working" }}subagent/completed
Section titled “subagent/completed”Subagent run completed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
subagent_id |
string |
yes | |
agent_id |
string | null |
||
name |
string | null |
||
label |
string | null |
||
status |
string |
yes | |
run_id |
string | null |
||
seq |
integer | null |
||
parent_session_id |
string | null |
||
parent_session_epoch |
string | null |
||
text |
string | null |
||
error |
EventError | null |
||
error_kind |
string | null |
||
usage |
any |
||
truncated |
boolean | null |
True when the outbound event tap truncated strings or projected images to stay within EVENT_MAX_BYTES. |
Example
{ "subagent_id": "child-1", "status": "completed", "parent_session_id": "parent-1"}approval
Section titled “approval”approval/requested
Section titled “approval/requested”Approval prompt opened or requested for an action.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
approval_id |
string |
yes | |
category |
string |
yes | |
tool_call_id |
string | null |
||
snapshot |
any |
||
child_approval_id |
integer | null |
||
truncated |
boolean | null |
Example
{ "approval_id": "ap-1", "category": "tool", "tool_call_id": "c-1", "snapshot": "snap-1"}approval/resolved
Section titled “approval/resolved”Approval prompt resolved with its decision outcome.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
approval_id |
string |
yes | |
category |
string |
yes | |
tool_call_id |
string | null |
||
result |
ApprovalResult |
yes | |
truncated |
boolean | null |
Example
{ "approval_id": "ap-1", "category": "tool", "tool_call_id": "c-1", "result": { "call": { "tool_call_id": "c-1", "name": "write" }, "decision": "allow", "source": "user" }}approval/changed
Section titled “approval/changed”Approval policy or revision changed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
policy |
any |
yes | |
revision |
integer |
yes |
Example
{ "policy": "ask", "revision": 1}approval/review-result
Section titled “approval/review-result”Automated approval reviewer outcome.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
category |
string |
yes | |
result |
object |
yes |
Example
{ "category": "exec", "result": { "call": { "name": "exec", "tool_call_id": "c-1" }, "decision": "allow", "source": "reviewer" }}status
Section titled “status”status/changed
Section titled “status/changed”Unified agent status changed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
state |
string |
yes | |
message |
string |
yes | |
session |
object |
yes | |
seq |
integer ≥ 0 |
yes | |
truncated |
boolean | null |
True when the outbound event tap truncated strings or projected images to stay within EVENT_MAX_BYTES. |
Example
{ "state": "idle", "message": "ready", "session": {}, "seq": 1}interaction
Section titled “interaction”interaction/requested
Section titled “interaction/requested”Interactive prompt opened and waiting for a responder.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
interaction_id |
string |
yes | |
kind |
InteractionKind |
yes | |
title |
string | null |
||
session_id |
string | null |
||
truncated |
boolean | null |
True when the outbound event tap truncated strings or projected images to stay within EVENT_MAX_BYTES. |
Example
{ "interaction_id": "int-1", "kind": "select", "title": "Pick"}interaction/resolved
Section titled “interaction/resolved”Interactive prompt finished with answered, cancelled, or unavailable.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
interaction_id |
string |
yes | |
kind |
InteractionKind |
yes | |
outcome |
InteractionOutcome |
yes | |
title |
string | null |
||
session_id |
string | null |
||
truncated |
boolean | null |
True when the outbound event tap truncated strings or projected images to stay within EVENT_MAX_BYTES. |
Example
{ "interaction_id": "int-1", "kind": "select", "outcome": "answered"}compact
Section titled “compact”compact/completed
Section titled “compact/completed”Context compaction completed (succeeded, cancelled, failed, or stalled).
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
cancelled |
boolean | null |
||
changed |
boolean |
yes | |
compact_id |
string |
||
compactions |
integer | null |
||
error |
{ code: string, data?: any, message: string } |
||
message |
string | null |
||
offloaded_count |
integer | null |
||
pruned_count |
integer | null |
||
reason |
string |
yes | |
stalled |
boolean | null |
||
status |
"completed" | "cancelled" | "failed" | "stalled" |
yes | |
tokens_after |
number |
yes | |
tokens_before |
number |
yes |
Example
{ "changed": true, "compact_id": "c-1", "reason": "auto", "status": "completed", "tokens_after": 60, "tokens_before": 100}compact/stage
Section titled “compact/stage”Best-effort compaction pipeline stage diagnostic.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
yes | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
changed |
boolean |
||
phase |
string |
yes | |
reason |
string |
||
stage |
string |
yes | |
tokens |
number |
||
tokens_after |
number |
||
tokens_before |
number |
Example
{ "phase": "before", "stage": "prune", "tokens": 100.0}compact/started
Section titled “compact/started”Context compaction started.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
compact_id |
string |
||
messages |
integer |
||
reason |
string |
yes |
Example
{ "compact_id": "c-1", "messages": 4, "reason": "manual"}jobs/changed
Section titled “jobs/changed”Background job state changed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
job |
object |
yes | |
truncated |
boolean |
Example
{ "job": { "job_id": "j-1", "kind": "bash", "owner": "bash", "started_at_ms": 1700000000000, "status": "running" }}model/changed
Section titled “model/changed”Active model selection changed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
model_id |
string |
yes | |
provider_id |
string |
yes | |
ref |
string |
yes |
Example
{ "model_id": "gpt-5", "provider_id": "openai", "ref": "openai/gpt-5"}permission
Section titled “permission”permission/changed
Section titled “permission/changed”Active permission preset or policy state changed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
label |
string |
||
partial |
boolean |
||
preset |
string |
Example
{ "label": "DEFAULT", "preset": "default"}session
Section titled “session”session/changed
Section titled “session/changed”Active session created, resumed, or forked.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
path |
string |
||
reason |
"resume" | "new" | "fork" |
yes | |
session_id |
string |
yes |
Example
{ "reason": "new", "session_id": "s-1"}ui/card
Section titled “ui/card”UI card emitted via ui.card (persistent cards are also written to session records).
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
required |
no | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
after_entry_id |
string |
||
block_id |
integer |
||
card_id |
string |
||
kind |
string |
yes | |
markdown |
string |
yes | |
meta |
any |
||
persistent |
boolean |
yes | |
title |
string |
yes |
Example
{ "kind": "info", "markdown": "**hi**", "persistent": false, "title": "Note"}ui/keymap-changed
Section titled “ui/keymap-changed”Runtime keymap bindings changed (set, delete, or detach cleanup).
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
action |
string | boolean |
||
context |
string |
||
key |
string |
||
session_id |
string |
Example
{ "action": "transcript", "context": "editor", "key": "ctrl+t"}ui/print
Section titled “ui/print”Ephemeral UI print output outside the durable session log.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
yes | no | continue |
| Field | Type | Required | Description |
|---|---|---|---|
lines |
string[] |
||
text |
string |
yes |
Example
{ "lines": [ "hello" ], "text": "hello"}usage/changed
Section titled “usage/changed”Session token usage and cost totals changed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
cache_read |
integer |
yes | |
cache_write |
integer |
yes | |
cache_write_1h |
integer |
||
cost |
number |
yes | |
cost_unknown |
boolean |
||
input |
integer |
yes | |
last_cache_read |
integer |
yes | |
last_context |
integer |
yes | |
output |
integer |
yes | |
requests |
integer |
yes | |
side_requests |
integer |
yes | |
subscription_requests |
integer |
yes |
Example
{ "cache_read": 0.0, "cache_write": 0.0, "cost": 0.01, "input": 1.0, "last_cache_read": 0.0, "last_context": 10.0, "output": 2.0, "requests": 1.0, "side_requests": 0.0, "subscription_requests": 0.0}web/providers-changed
Section titled “web/providers-changed”Registered web search or fetch providers changed.
| Mode | Delivery | Ignorable | Retain | On error |
|---|---|---|---|---|
emit |
lossy |
no | yes | continue |
| Field | Type | Required | Description |
|---|---|---|---|
action |
string |
||
kind |
string |
yes | |
provider_id |
string |
Example
{ "action": "added", "kind": "search", "provider_id": "brave"}