#[non_exhaustive]pub enum AgentEvent {
Show 16 variants
AgentStart,
AgentEnd {
messages: Vec<AgentMessage>,
},
TurnStart,
TurnEnd {
message: AgentMessage,
tool_results: Vec<ToolResultMessage>,
},
MessageStart {
message: AgentMessage,
},
MessageUpdate {
message: AgentMessage,
assistant_event: Box<AssistantStreamEvent>,
},
MessageEnd {
message: AgentMessage,
},
ToolExecutionStart {
tool_call_id: String,
tool_name: String,
args: Value,
},
ToolExecutionUpdate {
tool_call_id: String,
tool_name: String,
args: Value,
partial_result: Value,
},
ToolExecutionEnd {
tool_call_id: String,
tool_name: String,
result: Value,
details: Option<Value>,
is_error: bool,
},
QueueUpdate {
steering: Vec<String>,
follow_up: Vec<String>,
},
AutoRetryStart {
attempt: u32,
max_attempts: u32,
delay_ms: u64,
error_message: String,
},
AutoRetryEnd {
success: bool,
attempt: u32,
final_error: Option<String>,
},
CompactionStart {
reason: CompactionReason,
},
CompactionEnd {
reason: CompactionReason,
result: Option<CompactionResult>,
aborted: bool,
error_message: Option<String>,
},
SessionPersistError {
message: String,
},
}Expand description
Events emitted during the agent loop lifecycle.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AgentStart
The agent loop has started.
AgentEnd
The agent loop has ended. No more loop events will be emitted.
Fields
messages: Vec<AgentMessage>TurnStart
A new turn (provider request/response cycle) has started.
TurnEnd
A turn has ended with the assistant message and any tool results.
MessageStart
An assistant message has started streaming.
Fields
message: AgentMessageMessageUpdate
An assistant message has been updated with a stream event.
MessageEnd
An assistant message has finished streaming.
Fields
message: AgentMessageToolExecutionStart
Tool execution is about to begin.
ToolExecutionUpdate
Tool execution has produced a progress update.
ToolExecutionEnd
Tool execution has completed.
QueueUpdate
Queue messages were delivered to the conversation.
AutoRetryStart
A retryable provider error occurred; a retry attempt is starting.
AutoRetryEnd
A retry attempt concluded (either successfully or after exhausting attempts).
CompactionStart
Compaction has started. Emitted by the harness outside the agent loop.
Fields
reason: CompactionReasonCompactionEnd
Compaction has finished. Emitted by the harness outside the agent loop.
SessionPersistError
Session persistence failed (disk full, permissions, etc.).
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more