Skip to main content

agent_runtime/runtime/
run_failure.rs

1//! Failed run outcome, including its error, partial conversation, and emitted events.
2
3use super::RunEvent;
4use crate::{ErrorCategory, Message, RuntimeError};
5use uuid::Uuid;
6
7#[derive(Debug, thiserror::Error)]
8#[error("Agent run {run_id} failed: {error}")]
9pub struct RunFailure {
10    pub run_id: Uuid,
11    #[source]
12    pub error: RuntimeError,
13    pub messages: Vec<Message>,
14    pub events: Vec<RunEvent>,
15    pub iterations: usize,
16}
17
18impl RunFailure {
19    pub fn category(&self) -> ErrorCategory {
20        self.error.category()
21    }
22}