pub enum ObserverEvent {
AgentStart {
provider: String,
model: String,
},
LlmRequest {
provider: String,
model: String,
messages_count: usize,
},
LlmResponse {
provider: String,
model: String,
duration: Duration,
success: bool,
error_message: Option<String>,
input_tokens: Option<u64>,
output_tokens: Option<u64>,
},
AgentEnd {
provider: String,
model: String,
duration: Duration,
tokens_used: Option<u64>,
cost_usd: Option<f64>,
},
ToolCallStart {
tool: String,
},
ToolCall {
tool: String,
duration: Duration,
success: bool,
},
TurnComplete,
ChannelMessage {
channel: String,
direction: String,
},
HeartbeatTick,
Error {
component: String,
message: String,
},
}Expand description
Discrete events emitted by the agent runtime for observability.
Each variant represents a lifecycle event that observers can record, aggregate, or forward to external monitoring systems. Events carry just enough context for tracing and diagnostics without exposing sensitive prompt or response content.
Variants§
AgentStart
The agent orchestration loop has started a new session.
LlmRequest
A request is about to be sent to an LLM provider.
This is emitted immediately before a provider call so observers can print user-facing progress without leaking prompt contents.
LlmResponse
Result of a single LLM provider call.
Fields
AgentEnd
The agent session has finished.
Carries aggregate usage data (tokens, cost) when the provider reports it.
Fields
ToolCallStart
A tool call is about to be executed.
ToolCall
A tool call has completed with a success/failure outcome.
TurnComplete
The agent produced a final answer for the current user message.
ChannelMessage
A message was sent or received through a channel.
Fields
HeartbeatTick
Periodic heartbeat tick from the runtime keep-alive loop.
Error
An error occurred in a named component.
Trait Implementations§
Source§impl Clone for ObserverEvent
impl Clone for ObserverEvent
Source§fn clone(&self) -> ObserverEvent
fn clone(&self) -> ObserverEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more