Skip to main content

agent_storage/contracts/
stored_run_event.rs

1//! An immutable event in a run's ordered event stream.
2
3use chrono::{DateTime, Utc};
4use serde::{Deserialize, Serialize};
5use uuid::Uuid;
6
7/// An immutable event in a run's ordered event stream.
8#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
9pub struct StoredRunEvent {
10    pub run_id: Uuid,
11    /// Zero-based, contiguous sequence number within the run.
12    pub sequence: u64,
13    /// Stable event name; payload fields remain explicit and versionable.
14    pub kind: String,
15    pub iteration: Option<usize>,
16    pub tool_name: Option<String>,
17    #[serde(default)]
18    pub model_id: Option<String>,
19    #[serde(default)]
20    pub next_model_id: Option<String>,
21    #[serde(default)]
22    pub model_candidates: Option<Vec<String>>,
23    #[serde(default)]
24    pub attempted_candidates: Option<usize>,
25    pub error_category: Option<String>,
26    pub occurred_at: DateTime<Utc>,
27}