#[non_exhaustive]pub enum ExitReason {
Complete,
MaxTurns,
BudgetExhausted,
CircuitBreaker,
Timeout,
InterceptorHalt {
reason: String,
},
Error,
SafetyStop {
reason: String,
},
AwaitingApproval,
Custom(String),
}Expand description
Why an operator invocation ended. The caller needs to know this to decide what happens next (retry? continue? escalate?).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Complete
Model produced a final text response (natural completion).
MaxTurns
Hit the max_turns limit.
BudgetExhausted
Hit the cost budget (max_cost) or the tool-call step limit (max_tool_calls).
Use BudgetEvent sink notifications to distinguish the two causes.
CircuitBreaker
Circuit breaker tripped (consecutive failures).
Timeout
Wall-clock timeout.
InterceptorHalt
Interceptor/middleware halted execution.
Error
Unrecoverable error during execution.
SafetyStop
Provider safety system stopped generation (HTTP 200, content filtered).
Semantically distinct from Error (not a transport or execution failure)
and Complete (model did not finish naturally). Arrives via
StopReason::ContentFilter in the provider response — the provider
acknowledged the request but refused to complete it. Not retriable
without modification to the context or request.
AwaitingApproval
One or more tool calls require human approval before execution.
The calling layer should inspect OperatorOutput::effects for
Effect::ToolApprovalRequired entries, obtain approval, then
either execute the tools and re-enter the loop, or inject a denial
message and re-enter.
Custom(String)
Future exit reasons.
Trait Implementations§
Source§impl Clone for ExitReason
impl Clone for ExitReason
Source§fn clone(&self) -> ExitReason
fn clone(&self) -> ExitReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more