pub enum RunEvent {
SessionStarted {
session: Uuid,
},
TurnStarted {
session: Uuid,
turn: usize,
},
ModelStarted {
session: Uuid,
turn: usize,
model: String,
},
ModelFinished {
session: Uuid,
turn: usize,
},
ToolStarted {
session: Uuid,
turn: usize,
tool: String,
call_id: String,
},
ToolFinished {
session: Uuid,
turn: usize,
tool: String,
call_id: String,
ok: bool,
},
TurnFinished {
session: Uuid,
turn: usize,
},
RunFailed {
session: Uuid,
error: String,
},
}Expand description
An observable run-lifecycle event.
Events carry no content — no prompt text, tool arguments, tool outputs, file contents, or model response text. They carry only structural metadata (session id, turn number, model id, tool name, call id, success flag) so they are safe to export to any telemetry backend without leaking user data.
Variants§
SessionStarted
A session started (emitted once, before the first turn).
TurnStarted
A model turn began.
ModelStarted
The model provider was invoked for this turn.
Fields
ModelFinished
The model provider returned for this turn.
ToolStarted
A tool call was dispatched.
Fields
ToolFinished
A tool call completed.
Fields
TurnFinished
A turn completed.
RunFailed
The run failed.
Fields
error: StringA bounded error summary. Truncated to keep user content out of
telemetry: provider/tool response bodies embedded in error strings
are capped at ERROR_SUMMARY_MAX_CHARS characters. Use this for
debugging signal, not as a source of truth about user data.