pub enum AgentEvent {
Show 14 variants
RunStarted {},
MessageDelta {
message_id: MessageId,
content_index: u32,
delta: EventDelta,
},
ToolCallRequested {
tool_call_id: ToolCallId,
tool_name: String,
arguments: Value,
},
ApprovalRequested {
approval_id: ApprovalId,
tool_call_id: ToolCallId,
capabilities: Vec<String>,
resources: Vec<String>,
expires_at: ProtocolTimestamp,
},
ToolExecutionProgress {
tool_call_id: ToolCallId,
message: String,
completed_units: u64,
total_units: Option<u64>,
},
ToolExecutionPreview {
tool_call_id: ToolCallId,
presentation: ToolPresentation,
},
HostedToolStarted {
tool_call_id: ToolCallId,
tool_name: String,
},
HostedToolCompleted {
tool_call_id: ToolCallId,
tool_name: String,
arguments: Value,
outcome: HostedToolOutcome,
source_count: u32,
},
ModelRetryScheduled {
message_id: MessageId,
attempt: u32,
max_retries: u32,
delay_ms: u64,
},
ModelRetryStarted {
message_id: MessageId,
attempt: u32,
max_retries: u32,
},
TurnCheckpointed {},
SessionCompacted {
summary_message_id: MessageId,
compacted_through_message_id: MessageId,
},
SessionForked {
source_branch_id: BranchId,
branch_id: BranchId,
from_message_id: MessageId,
},
RunFinished {
status: RunStatus,
usage: Option<Usage>,
cost: Option<ExactCost>,
},
}Expand description
A provider- and UI-neutral observable runtime event.
Variants§
RunStarted
A run started.
MessageDelta
A streaming message fragment was produced.
Fields
delta: EventDeltaBounded content fragment.
ToolCallRequested
A complete tool call was requested by the model.
Fields
tool_call_id: ToolCallIdCanonical tool-call identifier.
ApprovalRequested
A tool call requires approval.
Fields
approval_id: ApprovalIdApproval request identifier.
tool_call_id: ToolCallIdTool call awaiting approval.
expires_at: ProtocolTimestampDecision deadline.
ToolExecutionProgress
Non-durable tool progress suitable for UI display.
Fields
tool_call_id: ToolCallIdTool call reporting progress.
ToolExecutionPreview
A trusted tool computed a bounded preview before a pending approval.
Fields
tool_call_id: ToolCallIdTool call the preview describes.
presentation: ToolPresentationTyped UI-only data produced from the tool’s current workspace view.
HostedToolStarted
A provider-hosted tool started inside the active model response.
Fields
tool_call_id: ToolCallIdKernel-owned activity identifier.
HostedToolCompleted
A provider-hosted tool completed inside the active model response.
Fields
tool_call_id: ToolCallIdKernel-owned activity identifier.
outcome: HostedToolOutcomeNormalized terminal outcome.
ModelRetryScheduled
A retryable model failure is waiting before another provider request.
Fields
ModelRetryStarted
A scheduled retry completed its backoff and is starting another request.
Fields
TurnCheckpointed
A turn reached a durable checkpoint.
SessionCompacted
Session history was compacted through a source message.
Fields
SessionForked
A new branch was forked from an existing branch/message.
Fields
RunFinished
A run reached a terminal state.
Implementations§
Source§impl AgentEvent
impl AgentEvent
Sourcepub const fn event_type(&self) -> AgentEventType
pub const fn event_type(&self) -> AgentEventType
Returns the stable event discriminator.
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