pub enum AgentSessionEvent {
Show 23 variants
AgentStart,
AgentEnd {
messages: Vec<AgentMessage>,
will_retry: bool,
},
AgentSettled {
aborted: bool,
},
TurnStart,
TurnEnd {
message: AgentMessage,
tool_results: Vec<ToolResultMessage>,
},
MessageStart {
message: AgentMessage,
},
MessageUpdate {
message: AgentMessage,
assistant_message_event: AssistantMessageEvent,
},
MessageEnd {
message: AgentMessage,
},
ToolExecutionStart {
tool_call_id: String,
tool_name: String,
args: JsonObject,
parent_tool_call_id: Option<String>,
},
ToolExecutionUpdate {
tool_call_id: String,
tool_name: String,
args: JsonObject,
partial_result: AgentToolResult,
parent_tool_call_id: Option<String>,
},
ToolExecutionEnd {
tool_call_id: String,
tool_name: String,
result: AgentToolResult,
is_error: bool,
duration_ms: Option<u64>,
parent_tool_call_id: Option<String>,
},
QueueUpdate {
steering: Vec<String>,
follow_up: Vec<String>,
},
CompactionStart {
reason: CompactionReason,
},
CompactionEnd {
reason: CompactionReason,
result: Option<CompactionResult>,
aborted: bool,
will_retry: bool,
error_message: Option<String>,
},
EntryAppended {
entry: SessionEntry,
},
SessionInfoChanged {
name: Option<String>,
},
ThinkingLevelChanged {
level: ThinkingLevel,
},
AutoRetryStart {
attempt: u32,
max_attempts: u32,
delay_ms: u64,
error_message: String,
},
AutoRetryEnd {
success: bool,
attempt: u32,
final_error: Option<String>,
},
SummarizationRetryScheduled {
attempt: u32,
max_attempts: u32,
delay_ms: u64,
error_message: String,
},
SummarizationRetryAttemptStart {
source: SummarizationSource,
},
SummarizationRetryFinished,
BashExecutionUpdate {
id: Option<String>,
delta: String,
},
}Expand description
One event emitted by an agent session.
Variants§
AgentStart
A run started.
AgentEnd
A run ended.
Fields
messages: Vec<AgentMessage>Messages the run added.
AgentSettled
The session became idle after activity.
TurnStart
A turn started.
TurnEnd
A turn ended.
Fields
message: AgentMessageAssistant message of the turn.
tool_results: Vec<ToolResultMessage>Tool results (serialised with role).
MessageStart
A message started.
Fields
message: AgentMessageThe message.
MessageUpdate
The streaming message changed.
Fields
message: AgentMessagePartial message.
assistant_message_event: AssistantMessageEventProvider event.
MessageEnd
A message is final.
Fields
message: AgentMessageThe message.
ToolExecutionStart
A tool call started.
Fields
args: JsonObjectArguments.
ToolExecutionUpdate
A tool published a partial result.
ToolExecutionEnd
A tool call settled.
Fields
result: AgentToolResultResult.
QueueUpdate
Complete steering / follow-up queues.
CompactionStart
Compaction started.
Fields
reason: CompactionReasonTrigger.
CompactionEnd
Compaction finished.
Fields
reason: CompactionReasonTrigger.
result: Option<CompactionResult>Result (absent on failure).
EntryAppended
An extension appended an entry.
Fields
entry: SessionEntryThe entry.
SessionInfoChanged
The session name changed (absent = cleared).
ThinkingLevelChanged
The thinking level changed.
Fields
level: ThinkingLevelNew level.
AutoRetryStart
An automatic retry is scheduled.
Fields
AutoRetryEnd
Automatic retries ended.
Fields
SummarizationRetryScheduled
A summarisation retry is scheduled.
Fields
SummarizationRetryAttemptStart
A summarisation retry attempt started.
Fields
source: SummarizationSourceWhat is being summarised.
SummarizationRetryFinished
Summarisation retries ended.
BashExecutionUpdate
Streaming output of a ! command.
Implementations§
Source§impl AgentSessionEvent
impl AgentSessionEvent
Sourcepub fn from_agent(event: AgentEvent, will_retry: bool) -> Self
pub fn from_agent(event: AgentEvent, will_retry: bool) -> Self
Maps a loop event to its session event (agent_end needs will_retry).