#[non_exhaustive]pub enum AgentEvent {
Show 38 variants
Start {
prompt: String,
},
TurnStart {
turn: usize,
},
TextDelta {
text: String,
},
ToolStart {
id: String,
name: String,
},
ToolInputDelta {
delta: String,
},
ToolEnd {
id: String,
name: String,
output: String,
exit_code: i32,
},
ToolOutputDelta {
id: String,
name: String,
delta: String,
},
TurnEnd {
turn: usize,
usage: TokenUsage,
},
End {
text: String,
usage: TokenUsage,
},
Error {
message: String,
},
ConfirmationRequired {
tool_id: String,
tool_name: String,
args: Value,
timeout_ms: u64,
},
ConfirmationReceived {
tool_id: String,
approved: bool,
reason: Option<String>,
},
ConfirmationTimeout {
tool_id: String,
action_taken: String,
},
ExternalTaskPending {
task_id: String,
session_id: String,
lane: SessionLane,
command_type: String,
payload: Value,
timeout_ms: u64,
},
ExternalTaskCompleted {
task_id: String,
session_id: String,
success: bool,
},
PermissionDenied {
tool_id: String,
tool_name: String,
args: Value,
reason: String,
},
ContextResolving {
providers: Vec<String>,
},
ContextResolved {
total_items: usize,
total_tokens: usize,
},
CommandDeadLettered {
command_id: String,
command_type: String,
lane: String,
error: String,
attempts: u32,
},
CommandRetry {
command_id: String,
command_type: String,
lane: String,
attempt: u32,
delay_ms: u64,
},
QueueAlert {
level: String,
alert_type: String,
message: String,
},
TaskUpdated {
session_id: String,
tasks: Vec<Task>,
},
MemoryStored {
memory_id: String,
memory_type: String,
importance: f32,
tags: Vec<String>,
},
MemoryRecalled {
memory_id: String,
content: String,
relevance: f32,
},
MemoriesSearched {
query: Option<String>,
tags: Vec<String>,
result_count: usize,
},
MemoryCleared {
tier: String,
count: u64,
},
SubagentStart {
task_id: String,
session_id: String,
parent_session_id: String,
agent: String,
description: String,
},
SubagentProgress {
task_id: String,
session_id: String,
status: String,
metadata: Value,
},
SubagentEnd {
task_id: String,
session_id: String,
agent: String,
output: String,
success: bool,
},
PlanningStart {
prompt: String,
},
PlanningEnd {
plan: ExecutionPlan,
estimated_steps: usize,
},
StepStart {
step_id: String,
description: String,
step_number: usize,
total_steps: usize,
},
StepEnd {
step_id: String,
status: TaskStatus,
step_number: usize,
total_steps: usize,
},
GoalExtracted {
goal: AgentGoal,
},
GoalProgress {
goal: String,
progress: f32,
completed_steps: usize,
total_steps: usize,
},
GoalAchieved {
goal: String,
total_steps: usize,
duration_ms: i64,
},
ContextCompacted {
session_id: String,
before_messages: usize,
after_messages: usize,
percent_before: f32,
},
PersistenceFailed {
session_id: String,
operation: String,
error: String,
},
}Expand description
Events emitted during agent execution
Subscribe via Session::subscribe_events().
New variants may be added in minor releases — always include a wildcard arm
(_ => {}) when matching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Start
Agent started processing
TurnStart
LLM turn started
TextDelta
Text delta from streaming
ToolStart
Tool execution started
ToolInputDelta
Tool input delta from streaming (partial JSON arguments)
ToolEnd
Tool execution completed
ToolOutputDelta
Intermediate tool output (streaming delta)
TurnEnd
LLM turn completed
End
Agent completed
Error
Error occurred
ConfirmationRequired
Tool execution requires confirmation (HITL)
ConfirmationReceived
Confirmation received from user (HITL)
ConfirmationTimeout
Confirmation timed out (HITL)
ExternalTaskPending
External task pending (needs SDK processing)
Fields
lane: SessionLaneExternalTaskCompleted
External task completed
PermissionDenied
Tool execution denied by permission policy
ContextResolving
Context resolution started
ContextResolved
Context resolution completed
CommandDeadLettered
Command moved to dead letter queue after exhausting retries
CommandRetry
Command retry attempt
QueueAlert
Queue alert (depth warning, latency alert, etc.)
TaskUpdated
Task list updated
MemoryStored
Memory stored
MemoryRecalled
Memory recalled
MemoriesSearched
Memories searched
MemoryCleared
Memory cleared
SubagentStart
Subagent task started
Fields
SubagentProgress
Subagent task progress update
Fields
SubagentEnd
Subagent task completed
Fields
PlanningStart
Planning phase started
PlanningEnd
Planning phase completed
StepStart
Step execution started
StepEnd
Step execution completed
GoalExtracted
Goal extracted from prompt
GoalProgress
Goal progress update
GoalAchieved
Goal achieved
ContextCompacted
Context automatically compacted due to high usage
PersistenceFailed
Session persistence failed — SDK clients should handle this
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more