Skip to main content

agent_service/run/
run_event.rs

1//! Events emitted during a run lifecycle.
2
3use super::RunEventKind;
4use std::time::SystemTime;
5
6/// An immutable, ordered entry in a run's lifecycle history.
7#[derive(Debug, Clone)]
8pub struct RunEvent {
9    /// Zero-based sequence number, monotonically increasing within a run.
10    pub sequence: u64,
11    pub kind: RunEventKind,
12    /// Runtime iteration for model and tool events; absent for lifecycle events.
13    pub iteration: Option<usize>,
14    /// Tool name for tool execution events.
15    pub tool_name: Option<String>,
16    /// Provider-qualified model identity associated with a routing event.
17    pub model_id: Option<String>,
18    /// Next provider-qualified candidate selected for a fallback attempt.
19    pub next_model_id: Option<String>,
20    /// Deterministically ordered compatible model candidates.
21    pub model_candidates: Option<Vec<String>>,
22    /// Number of candidates attempted before routing terminated.
23    pub attempted_candidates: Option<usize>,
24    /// Stable error category; raw error messages are excluded.
25    pub error_category: Option<&'static str>,
26    pub occurred_at: SystemTime,
27}