agent_runtime/runtime/run_status.rs
1//! Terminal and intermediate states of an agent run.
2
3use crate::ErrorCategory;
4
5#[derive(Debug, Clone, PartialEq, Eq)]
6pub enum RunStatus {
7 Completed,
8 MaxIterationsReached,
9 Cancelled,
10 TimedOut,
11}
12
13impl RunStatus {
14 pub fn error_category(&self) -> Option<ErrorCategory> {
15 match self {
16 Self::Cancelled => Some(ErrorCategory::Cancellation),
17 Self::TimedOut => Some(ErrorCategory::Timeout),
18 Self::Completed | Self::MaxIterationsReached => None,
19 }
20 }
21}