Skip to main content

TurnInterruption

Enum TurnInterruption 

Source
pub enum TurnInterruption {
Show 16 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, }, 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.

Variants§

§

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.

Fields

§limit: u32

Configured maximum for this execution.

§

MaxToolCalls

New declarations committed, but their cumulative count exceeds the limit.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§limit: u32

Configured maximum for this execution.

§declared_before: u32

Number of declarations accepted in earlier invocations.

§declared_this_round: usize

Untruncated number of newly committed declarations.

§

ToolCatalogFailed

Tool binding failed before preparation or model invocation.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ToolCatalogError

Original typed failure, including any inputs owned by that error.

§

PrepareFailed

Preparation failed; any edits already committed by the preparer remain.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: PrepareError

Original typed failure, including any inputs owned by that error.

§

ModelCallFailed

The logical gateway call failed; its original classification is retained.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ModelInvokeError

Original typed failure, including any inputs owned by that error.

§

ModelMaxTokens

Generation reached its token limit; the complete output was not committed.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§

ModelRefusal

The model refused; the complete output was not committed.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§

ModelConversionFailed

Pure conversion failed before commit, retaining output and supplied IDs.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ModelBlockError

Original typed failure, including any inputs owned by that error.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§block_ids: Vec<BlockId>

All IDs supplied to the failed pure conversion.

§

ModelBatchFailed

Fresh batch construction failed before the converted blocks were committed.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: BatchError

Original typed failure, including any inputs owned by that error.

§output: ModelOutput

The 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: InvocationId

The logical invocation associated with this stage.

§error: EditFailure

Original typed failure, including any inputs owned by that error.

§output: ModelOutput

The complete uncommitted model output, including usage and reasoning.

§

ToolProcessingFailed

Tool processing failed; the complete current batch is returned in the outcome.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ToolProcessingError

Original typed failure, including any inputs owned by that error.

§

ToolResultValidationFailed

Result scope validation failed; the complete batch remains uncommitted.

Fields

§invocation_id: InvocationId

The logical invocation associated with this stage.

§error: ToolResultError

Original 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: InvocationId

The logical invocation associated with this stage.

§error: EditFailure

Original 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: InvocationId

The logical invocation associated with this stage.

§call_block_id: BlockId

Declaration of the first unknown result in final postprocessor order.

Trait Implementations§

Source§

impl Debug for TurnInterruption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TurnInterruption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more