pub enum ContextError {
SealedTurn,
ForeignInvocation {
expected: TurnId,
actual: TurnId,
},
InvalidModelOutput(String),
InvalidSequence(String),
DuplicateToolCallId(ToolCallId),
UnpairedToolResult(ToolCallId),
}Expand description
Fact-machine rejections: lifecycle, pairing, or structural-validity violations. None carry transport or execution semantics.
Variants§
SealedTurn
The turn is sealed and rejects appends.
ForeignInvocation
A model output was submitted under a different turn id than the context’s own.
Fields
InvalidModelOutput(String)
The model response is structurally invalid (bad stop-reason/tool-call pairing, empty tool name, or non-object arguments).
InvalidSequence(String)
Sequence or pairing state is invalid (monotonicity, duplicate or already-paired tool results).
DuplicateToolCallId(ToolCallId)
A tool call id already exists in the fact state.
UnpairedToolResult(ToolCallId)
A tool result references a call id no committed call block issued.
Trait Implementations§
Source§impl Debug for ContextError
impl Debug for ContextError
Source§impl Display for ContextError
impl Display for ContextError
Source§impl Error for ContextError
impl Error for ContextError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ContextError
impl RefUnwindSafe for ContextError
impl Send for ContextError
impl Sync for ContextError
impl Unpin for ContextError
impl UnsafeUnpin for ContextError
impl UnwindSafe for ContextError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more