pub enum TurnInterruption {
ExplicitCancellation,
TurnDeadlineExceeded,
RetryExhausted {
last_kind: ModelInvokeErrorKind,
last_error: String,
},
InvalidModelOutput {
reason: String,
},
MaxModelRounds {
limit: u32,
},
MaxToolCalls {
limit: u32,
},
UnsafeUnknownOutcome {
call_id: ToolCallId,
},
CompactionFailed {
reason: String,
},
RunnerInvariantViolation {
reason: String,
},
ModelMaxTokens,
ModelRefusal,
}Expand description
Why a turn terminated in TurnResult::Interrupted. The serde shape
(kind / detail) is part of the event wire contract; see the
wire-contract note on TurnOutcome.
Variants§
ExplicitCancellation
The host cancelled the turn through the shared RunControl token
(including cancellation observed mid-call, mid-stream, or during
retry backoff).
TurnDeadlineExceeded
The turn deadline carried by RunControl passed (checked at every
loop top; retry backoff caps its wait at the remaining deadline and
re-checks before each attempt, and a retry loop that gives up after
the deadline has passed ends here rather than with the last
attempt’s error kind).
RetryExhausted
Uniform carrier for terminal model-call failures: retry exhaustion
and non-retryable kinds (Permanent / InvalidRequest / UnknownOutcome)
all land here, discriminated by last_kind; a parent-caused
Cancelled maps to ExplicitCancellation instead.
Fields
last_kind: ModelInvokeErrorKindError kind of the final failed attempt — retry exhaustion and non-retryable kinds alike.
InvalidModelOutput
The kernel refused the model response —
TurnContext::append_model_output rejected it.
MaxModelRounds
The loop reached TurnLimits::max_model_rounds before the model
ended the turn.
MaxToolCalls
The turn emitted more than TurnLimits::max_tool_calls tool calls
(counted at dispatch time, including a batch paused pending
approval).
UnsafeUnknownOutcome
A tool call ended UnknownOutcome while its trusted declaration
demands Stop — the call’s result is unknowable, so continuing
is unsafe.
Fields
call_id: ToolCallIdThe offending call.
CompactionFailed
Turn-scope frame materialization failed — FramePolicy::materialize
returned an error.
RunnerInvariantViolation
A driver invariant broke (e.g. the fact machine refused an append) — a caller bug, not a model or tool failure.
ModelMaxTokens
The model stopped on the token ceiling; the driver dispatches this before applying, so no blocks persist.
ModelRefusal
The model refused; the driver dispatches this before applying, so no blocks persist.
Trait Implementations§
Source§impl Clone for TurnInterruption
impl Clone for TurnInterruption
Source§fn clone(&self) -> TurnInterruption
fn clone(&self) -> TurnInterruption
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more