pub enum Event {
ThreadStarted {
thread_id: String,
},
TurnStarted,
TurnCompleted {
usage: Option<Usage>,
},
TurnFailed {
usage: Option<Usage>,
error: Option<ThreadError>,
},
ItemStarted {
item: Item,
},
ItemUpdated {
item: Item,
},
ItemCompleted {
item: Item,
},
TokenCount {
input_tokens: u64,
cached_input_tokens: u64,
output_tokens: u64,
},
Error {
message: Option<String>,
},
Unknown,
}Expand description
A single JSONL event read from codex exec --json stdout.
Deserialized via #[serde(tag = "type")] so the "type" field selects
the variant. Unknown event types deserialize as Event::Unknown.
Variants§
ThreadStarted
A thread has been created for this execution.
TurnStarted
A new turn has started.
TurnCompleted
A turn completed successfully.
TurnFailed
A turn failed.
Fields
error: Option<ThreadError>Error details.
ItemStarted
An item has started (message, command, file change, etc.).
ItemUpdated
Incremental update to an in-flight item.
ItemCompleted
An item has completed.
TokenCount
Token usage statistics.
Fields
Error
An execution-level error.
Unknown
Forward-compatibility: any unrecognized event type.
Implementations§
Source§impl Event
impl Event
Sourcepub fn is_thread_started(&self) -> bool
pub fn is_thread_started(&self) -> bool
Returns true if this is a Event::ThreadStarted.
Sourcepub fn is_turn_completed(&self) -> bool
pub fn is_turn_completed(&self) -> bool
Returns true if this is a Event::TurnCompleted.
Sourcepub fn is_turn_failed(&self) -> bool
pub fn is_turn_failed(&self) -> bool
Returns true if this is a Event::TurnFailed.
Sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Returns true if this is an Event::Error.
Sourcepub fn is_item_completed(&self) -> bool
pub fn is_item_completed(&self) -> bool
Returns true if this is an Event::ItemCompleted.