#[non_exhaustive]pub enum AgentEvent {
LlmCallStarted,
LlmCallCompleted {
tokens: u32,
latency_ms: u64,
},
ToolCallStarted {
name: String,
},
ToolCallCompleted {
name: String,
ok: bool,
},
Completed,
Failed {
reason: String,
},
Suspended {
reason: String,
},
}Expand description
Step-level event emitted by the runtime during Agent::run.
Wire shape is transport-agnostic; MCP HTTP maps each variant
to a notifications/progress JSON-RPC notification.
Default AgentContext::progress is None, so emission is a
no-op for callers that don’t opt in. Transports opt in by
passing a broadcast::Sender when constructing the context.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LlmCallStarted
LLM call about to be issued.
LlmCallCompleted
LLM call returned a response. tokens is prompt + completion
when the provider streams a usage payload on the final chunk;
0 when the provider does not emit usage in stream mode.
Fields
ToolCallStarted
Tool dispatch begun for name.
ToolCallCompleted
Tool dispatch returned. ok = false means the tool
errored; the wire-level redaction policy decides what to
surface.
Completed
Agent reached its final assistant response.
Failed
Agent failed terminally. reason is a sanitised summary;
inner error chain is logged server-side by the runtime’s
existing tracing::error! path on the Err return.
Suspended
Run suspended at a step awaiting human approval (ADR-045).
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