#[non_exhaustive]pub enum TurnInterruption {
Show 18 variants
Cancelled {
invocation_id: Option<InvocationId>,
},
DeadlineExceeded {
invocation_id: Option<InvocationId>,
},
MaxModelRounds {
limit: u32,
},
MaxToolCalls {
invocation_id: InvocationId,
limit: u32,
declared_before: u32,
declared_this_round: usize,
},
ToolCatalogFailed {
invocation_id: InvocationId,
error: ToolCatalogError,
},
PrepareFailed {
invocation_id: InvocationId,
error: PrepareError,
},
ModelCallFailed {
invocation_id: InvocationId,
error: ModelInvokeError,
},
ModelMaxTokens {
invocation_id: InvocationId,
output: ModelOutput,
},
ModelRefusal {
invocation_id: InvocationId,
output: ModelOutput,
},
ModelContextWindowExceeded {
invocation_id: InvocationId,
output: ModelOutput,
},
ModelStopUnrecognized {
invocation_id: InvocationId,
output: ModelOutput,
},
ModelConversionFailed {
invocation_id: InvocationId,
error: ModelBlockError,
output: ModelOutput,
block_ids: Vec<BlockId>,
},
ModelBatchFailed {
invocation_id: InvocationId,
error: BatchError,
output: ModelOutput,
blocks: Vec<ContextBlock>,
},
ModelCommitFailed {
invocation_id: InvocationId,
error: EditFailure,
output: ModelOutput,
},
ToolProcessingFailed {
invocation_id: InvocationId,
error: ToolProcessingError,
},
ToolResultValidationFailed {
invocation_id: InvocationId,
error: ToolResultError,
},
ToolCommitFailed {
invocation_id: InvocationId,
error: EditFailure,
},
UnknownToolOutcome {
invocation_id: InvocationId,
call_block_id: BlockId,
},
}Expand description
Typed interruption causes retaining the relevant failure inputs.
Display gives one sentence a host can show. More causes may be added; a
match needs a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cancelled
Caller cancellation stopped an unselected execution stage.
Fields
invocation_id: Option<InvocationId>Logical invocation, or none when stopping between invocations.
DeadlineExceeded
The inherited absolute execution deadline stopped a stage.
Fields
invocation_id: Option<InvocationId>Logical invocation, or none when stopping between invocations.
MaxModelRounds
The logical invocation limit was reached before creating a new invocation.
MaxToolCalls
New declarations committed, but their cumulative count exceeds the limit.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
ToolCatalogFailed
Tool binding failed before preparation or model invocation.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: ToolCatalogErrorOriginal typed failure, including any inputs owned by that error.
PrepareFailed
Preparation failed; any edits already committed by the preparer remain.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: PrepareErrorOriginal typed failure, including any inputs owned by that error.
ModelCallFailed
The logical gateway call failed; its original classification is retained.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: ModelInvokeErrorOriginal typed failure, including any inputs owned by that error.
ModelMaxTokens
Generation reached its token limit; the complete output was not committed.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
output: ModelOutputThe complete uncommitted model output, including usage and reasoning.
ModelRefusal
The model refused; the complete output was not committed.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
output: ModelOutputThe complete uncommitted model output, including usage and reasoning.
ModelContextWindowExceeded
The provider stopped on the context window; the complete output was not committed.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
output: ModelOutputThe complete uncommitted model output, including usage and reasoning.
ModelStopUnrecognized
The provider reported a stop value the kernel has no meaning for; the
complete output was not committed. The wire value is on
output.raw_stop_reason and is kept out of this message, because it
is provider text of any length and content.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
output: ModelOutputThe complete uncommitted model output, including usage and reasoning.
ModelConversionFailed
Pure conversion failed before commit, retaining output and supplied IDs.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: ModelBlockErrorOriginal typed failure, including any inputs owned by that error.
output: ModelOutputThe complete uncommitted model output, including usage and reasoning.
ModelBatchFailed
Fresh batch construction failed before the converted blocks were committed.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: BatchErrorOriginal typed failure, including any inputs owned by that error.
output: ModelOutputThe complete uncommitted model output, including usage and reasoning.
blocks: Vec<ContextBlock>All converted blocks rejected before model commit.
ModelCommitFailed
Atomic model append failed; the edit error retains every submitted block.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: EditFailureOriginal typed failure, including any inputs owned by that error.
output: ModelOutputThe complete uncommitted model output, including usage and reasoning.
ToolProcessingFailed
Tool processing failed; the complete current batch is returned in the outcome.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: ToolProcessingErrorOriginal typed failure, including any inputs owned by that error.
ToolResultValidationFailed
Result scope validation failed; the complete batch remains uncommitted.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: ToolResultErrorOriginal typed failure, including any inputs owned by that error.
ToolCommitFailed
Atomic tool-result append failed; both the batch and edit inputs are retained.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
error: EditFailureOriginal typed failure, including any inputs owned by that error.
UnknownToolOutcome
The full result batch committed, then execution stopped on an unknown result.
Fields
invocation_id: InvocationIdThe logical invocation associated with this stage.
Trait Implementations§
Source§impl Debug for TurnInterruption
impl Debug for TurnInterruption
Source§impl Display for TurnInterruption
impl Display for TurnInterruption
Source§impl Error for TurnInterruption
impl Error for TurnInterruption
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()