pub enum ObserverEvent {
Show 16 variants
AgentStart {
model_provider: String,
model: String,
},
LlmRequest {
model_provider: String,
model: String,
messages_count: usize,
},
LlmResponse {
model_provider: String,
model: String,
duration: Duration,
success: bool,
error_message: Option<String>,
input_tokens: Option<u64>,
output_tokens: Option<u64>,
},
AgentEnd {
model_provider: String,
model: String,
duration: Duration,
tokens_used: Option<u64>,
cost_usd: Option<f64>,
},
ToolCallStart {
tool: String,
tool_call_id: Option<String>,
arguments: Option<String>,
},
ToolCall {
tool: String,
tool_call_id: Option<String>,
duration: Duration,
success: bool,
arguments: Option<String>,
result: Option<String>,
},
TurnComplete,
ChannelMessage {
channel: String,
direction: String,
},
HeartbeatTick,
CacheHit {
cache_type: String,
tokens_saved: u64,
},
CacheMiss {
cache_type: String,
},
Error {
component: String,
message: String,
},
DeploymentStarted {
deploy_id: String,
},
DeploymentCompleted {
deploy_id: String,
commit_sha: String,
},
DeploymentFailed {
deploy_id: String,
reason: String,
},
RecoveryCompleted {
deploy_id: 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 model_provider.
This is emitted immediately before a model_provider call so observers can print user-facing progress without leaking prompt contents.
LlmResponse
Result of a single LLM model_provider call.
Fields
AgentEnd
The agent session has finished.
Carries aggregate usage data (tokens, cost) when the model_provider reports it.
Fields
ToolCallStart
A tool call is about to be executed.
Fields
tool_call_id: Option<String>Provider-assigned tool call identifier, when the underlying tool
call originated from a native structured tool call block (e.g.
OpenAI tool_calls[].id, Anthropic tool_use.id). None for
text-parsed (XML/markdown) tool calls.
Observers can correlate ToolCallStart → ToolCall → the
emitting LLM response via this id.
ToolCall
A tool call has completed with a success/failure outcome.
Fields
tool_call_id: Option<String>Provider-assigned tool call identifier, when present. See
ObserverEvent::ToolCallStart::tool_call_id.
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.
CacheHit
Response cache hit — an LLM call was avoided.
Fields
CacheMiss
Response cache miss — the prompt was not found in cache.
Error
An error occurred in a named component.
Fields
DeploymentStarted
A deployment has started.
DeploymentCompleted
A deployment has completed successfully.
DeploymentFailed
A deployment has failed.
RecoveryCompleted
Recovery from a failed deployment has completed.
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