tirea_agentos/composition/
stop_condition.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4/// Declarative stop-condition configuration consumed by runtime stop policies.
5#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
6#[serde(tag = "type", rename_all = "snake_case")]
7pub enum StopConditionSpec {
8    MaxRounds { rounds: usize },
9    Timeout { seconds: u64 },
10    TokenBudget { max_total: usize },
11    ConsecutiveErrors { max: usize },
12    StopOnTool { tool_name: String },
13    ContentMatch { pattern: String },
14    LoopDetection { window: usize },
15}