pub enum ExecEvent {
ThreadStarted {
thread: Thread,
},
TurnStarted {
thread_id: String,
turn: Turn,
},
TurnCompleted {
thread_id: String,
turn: Turn,
},
TurnFailed {
thread_id: String,
turn_id: String,
error: TurnError,
},
ItemStarted {
thread_id: String,
started_at_ms: i64,
item: ThreadItem,
},
ItemCompleted {
thread_id: String,
completed_at_ms: i64,
item: ThreadItem,
},
AgentMessageDelta {
thread_id: String,
item_id: String,
delta: String,
},
TokenUsage {
thread_id: String,
turn_id: String,
token_usage: ThreadTokenUsage,
},
Raw {
method: String,
params: Option<Value>,
},
}Expand description
One renderable event, tagged in codex exec JSONL style.
Typed payloads (ThreadItem, Turn, …) are embedded directly — they
already serialize to their wire shapes, so consumers get stable JSON
without a re-serialization layer.
Variants§
ThreadStarted
TurnStarted
TurnCompleted
TurnFailed
A turn-scoped error (error notification) — the closest app-server
analog to exec’s turn.failed.
ItemStarted
ItemCompleted
AgentMessageDelta
Streamed agent-message text for the active item.
TokenUsage
Per-turn token accounting (thread/tokenUsage/updated).
Raw
Any notification without a first-class mapping above — including methods newer than these bindings. The wire method and params are preserved verbatim so nothing is droppable-by-default.
Implementations§
Source§impl ExecEvent
impl ExecEvent
Sourcepub fn from_notification(notification: Notification) -> ExecEvent
pub fn from_notification(notification: Notification) -> ExecEvent
Map one notification onto its exec-style event. Never fails and
never drops: lifecycle notifications get first-class variants,
everything else round-trips through ExecEvent::Raw.