Skip to main content

RuntimeError

Enum RuntimeError 

Source
pub enum RuntimeError {
Show 48 variants StepAlreadyActive { session_id: SessionId, }, SessionClosed { session_id: SessionId, }, InvalidStepInput { reason: &'static str, }, AgentLoopConfig { source: AgentLoopConfigError, }, ChildRuntimeBuild { message: String, }, InvalidSubagentSelection { operation: &'static str, }, Plan { source: PlanError, }, InvalidUserImageInput { reason: String, }, UnknownToolCall { session_id: SessionId, call_id: ToolCallId, }, BridgeToolResultBatchEmpty { session_id: SessionId, }, BridgeToolResultBatchMismatch { session_id: SessionId, expected_call_ids: Vec<ToolCallId>, received_call_ids: Vec<ToolCallId>, }, BridgeToolResultBatchIdMismatch { session_id: SessionId, expected_batch_id: ToolCallBatchId, received_batch_id: ToolCallBatchId, }, BridgeToolResultRejected { session_id: SessionId, message: String, }, AgentRunToolInvocationsPending { session_id: SessionId, batch_id: ToolCallBatchId, }, NoPendingAgentRunToolInvocations { session_id: SessionId, }, ToolCallAlreadyResolved { session_id: SessionId, call_id: ToolCallId, }, DuplicateToolRegistration { name: ToolName, }, ReservedToolName { name: ToolName, }, InvalidToolInputSchema { name: ToolName, message: String, }, BridgeToolsNotAllowed { name: ToolName, }, ToolExecutionCancelled { session_id: SessionId, call_id: ToolCallId, }, ToolExecutionFailed { session_id: SessionId, call_id: ToolCallId, message: String, }, AgentRunClosed { session_id: SessionId, message: &'static str, }, MissingActionExecutionEvidence { session_id: SessionId, call_id: ToolCallId, action_kind: ToolActionKind, }, MutatingActionCommitLifecycleRequired { session_id: SessionId, call_id: ToolCallId, action_kind: ToolActionKind, }, UnsupportedToolResultContent { call_id: ToolCallId, output_kind: ToolOutputKind, }, TranscriptItemIdExhausted, ModelTurnIdExhausted, UnknownModelTurn { model_turn_id: u64, }, InvalidModelTurnTransition { model_turn_id: u64, attempted: &'static str, }, TranscriptToolCallMissing { call_id: ToolCallId, }, Core { source: CoreError, }, Context { source: ContextError, }, Checkpoint { source: CheckpointError, }, Compaction { source: CompactionError, }, SessionStore { source: SessionStoreError, }, MissingModelProvider { role: &'static str, }, CompactionModelRequest { message: String, }, CompactionModelWindowTooSmall { primary_window_tokens: u64, compactor_window_tokens: u64, }, CompactionModelRequestTooLarge { estimated_input_tokens: u64, max_output_tokens: u64, compactor_window_tokens: u64, }, CompactionModelTruncated { message: String, }, CompactionModelSetup { message: String, }, CompactionModelStream { message: String, }, AgentRunHookInvocationPending { session_id: SessionId, invocation_id: HookInvocationId, }, NoPendingAgentRunHookInvocation { session_id: SessionId, }, HookInvocationIdMismatch { session_id: SessionId, expected_invocation_id: HookInvocationId, received_invocation_id: HookInvocationId, }, HookFailed { session_id: SessionId, hook_point: HookPoint, message: String, }, HookCancelled { session_id: SessionId, hook_point: HookPoint, },
}
Expand description

Errors raised by Merry runtime construction and step admission.

Variants are actionable contract failures at the runtime facade boundary. Cancellation and executor infrastructure failures leave pending tool calls unresolved unless a durable result was already recorded.

Variants§

§

StepAlreadyActive

A new step was requested while another step still owns the runtime.

Fields

§session_id: SessionId

Session with an active step.

§

SessionClosed

An operation was requested on a runtime whose session has already been closed.

Fields

§session_id: SessionId

Closed session identifier.

§

InvalidStepInput

Step input failed runtime validation.

Fields

§reason: &'static str

Actionable validation detail.

§

AgentLoopConfig

An agent-loop entry point received conflicting structured-output contracts from its context and loop configuration.

Fields

§source: AgentLoopConfigError

Invalid loop configuration detail.

§

ChildRuntimeBuild

A child runtime factory could not materialize its runtime profile.

Fields

§message: String

Profile construction detail from the owning composition layer.

§

InvalidSubagentSelection

A subagent status operation did not select any child agents.

Fields

§operation: &'static str

Provider-visible operation that received the empty selection.

§

Plan

A Plan Mode operation failed validation or referenced an unknown plan.

Fields

§source: PlanError

Source plan error.

§

InvalidUserImageInput

A user image or image-bearing message failed runtime validation.

Fields

§reason: String

Actionable image validation detail.

§

UnknownToolCall

A submitted tool result does not match any pending or resolved call.

Fields

§session_id: SessionId

Session receiving the result.

§call_id: ToolCallId

Tool call id that could not be found.

§

BridgeToolResultBatchEmpty

A bridge result submission did not contain any outcomes.

Fields

§session_id: SessionId

Session receiving the empty result batch.

§

BridgeToolResultBatchMismatch

A bridge result submission did not resolve exactly the requested calls.

Fields

§session_id: SessionId

Session receiving the mismatched result batch.

§expected_call_ids: Vec<ToolCallId>

Call ids currently waiting for external execution.

§received_call_ids: Vec<ToolCallId>

Call ids supplied by the external executor.

§

BridgeToolResultBatchIdMismatch

A bridge result was submitted for a different runtime-owned batch.

Fields

§session_id: SessionId

Session receiving the stale or mismatched result.

§expected_batch_id: ToolCallBatchId

Runtime-owned batch id currently awaiting results.

§received_batch_id: ToolCallBatchId

Batch id supplied by the host.

§

BridgeToolResultRejected

A host result could not be recorded, but the pending call can still be resolved as a failed tool result so the model loop can recover.

Fields

§session_id: SessionId

Session receiving the host result.

§message: String

Original runtime validation or persistence detail.

§

AgentRunToolInvocationsPending

The run cannot read another message until its current host batch is resolved.

Fields

§session_id: SessionId

Session whose run is waiting for host results.

§batch_id: ToolCallBatchId

Batch that must be resolved first.

§

NoPendingAgentRunToolInvocations

A host submitted results when the run has no active host batch.

Fields

§session_id: SessionId

Session receiving the submission.

§

ToolCallAlreadyResolved

A tool result was submitted after the call had already been resolved.

Fields

§session_id: SessionId

Session receiving the duplicate result.

§call_id: ToolCallId

Tool call id that already has a result.

§

DuplicateToolRegistration

Runtime construction tried to register the same tool name more than once.

Fields

§name: ToolName

Duplicate tool name.

§

ReservedToolName

Runtime-reserved provider-visible tool name was registered by an application.

Fields

§name: ToolName

Rejected reserved tool name.

§

InvalidToolInputSchema

Runtime construction received a tool schema that JSON Schema validation cannot compile.

Fields

§name: ToolName

Tool with the invalid input schema.

§message: String

Actionable schema compiler detail.

§

BridgeToolsNotAllowed

Runtime construction tried to register a bridge tool without explicit opt-in.

Fields

§name: ToolName

Bridge tool name.

§

ToolExecutionCancelled

Tool execution was cancelled before producing a durable result.

Fields

§session_id: SessionId

Session executing the tool call.

§call_id: ToolCallId

Tool call id that remained pending.

§

ToolExecutionFailed

Tool executor infrastructure failed before producing a durable result.

Fields

§session_id: SessionId

Session executing the tool call.

§call_id: ToolCallId

Tool call id that remained pending.

§message: String

Actionable executor failure detail.

§

AgentRunClosed

A runtime-owned agent run stopped before producing a terminal result.

Fields

§session_id: SessionId

Session whose run ended unexpectedly.

§message: &'static str

Actionable stream lifecycle detail.

§

MissingActionExecutionEvidence

An admitted mutating action reported success without internal execution evidence.

Fields

§session_id: SessionId

Session executing the tool call.

§call_id: ToolCallId

Tool call id that remained pending.

§action_kind: ToolActionKind

Action kind that required internal execution evidence.

§

MutatingActionCommitLifecycleRequired

A mutating action reached the generic executor path before a commit lifecycle exists.

Fields

§session_id: SessionId

Session executing the tool call.

§call_id: ToolCallId

Tool call id that remained pending.

§action_kind: ToolActionKind

Mutating action kind that must use a commit lifecycle.

§

UnsupportedToolResultContent

A tool result used invalid or blank output content.

Fields

§call_id: ToolCallId

Tool call identifier for the submitted tool result.

§output_kind: ToolOutputKind

Submitted output category.

§

TranscriptItemIdExhausted

Transcript item ids are exhausted for this session.

§

ModelTurnIdExhausted

Model turn ids are exhausted for this session.

§

UnknownModelTurn

A transcript mutation referenced a model turn that is not recorded.

Fields

§model_turn_id: u64
§

InvalidModelTurnTransition

A transcript mutation attempted to change a terminal or incompatible turn.

Fields

§model_turn_id: u64
§attempted: &'static str
§

TranscriptToolCallMissing

A pending tool call was not represented in the durable transcript.

Fields

§call_id: ToolCallId
§

Core

A core protocol value could not be constructed.

Fields

§source: CoreError

Source core validation error.

§

Context

Context state could not be constructed or compiled.

Fields

§source: ContextError

Source context error.

§

Checkpoint

Checkpoint state could not be inspected or validated.

Fields

§source: CheckpointError

Source checkpoint error.

§

Compaction

Compaction state could not be constructed or applied.

Fields

§source: CompactionError

Source compaction error.

§

SessionStore

Session persistence failed.

Fields

§source: SessionStoreError

Source session store error.

§

MissingModelProvider

A runtime operation needed a model provider for a role that is not configured.

Fields

§role: &'static str

Missing model role.

§

CompactionModelRequest

Compaction model request construction failed.

Fields

§message: String

Actionable model request error.

§

CompactionModelWindowTooSmall

The configured compaction model cannot accept the primary model’s context window.

Fields

§primary_window_tokens: u64

Resolved primary model context window.

§compactor_window_tokens: u64

Provider-reported compaction model input window.

§

CompactionModelRequestTooLarge

The compiled compaction request cannot hold its input and reserved output together.

Fields

§estimated_input_tokens: u64

Deterministic estimate of the compiled provider-neutral request input.

§max_output_tokens: u64

Output ceiling reserved for reasoning and checkpoint text.

§compactor_window_tokens: u64

Reported or primary-window-assumed compaction model window.

§

CompactionModelTruncated

The compaction model stopped before it produced a complete checkpoint.

Fields

§message: String

Actionable truncation diagnostic, including the provider’s reason.

§

CompactionModelSetup

Compaction model setup failed before a stream was returned.

Fields

§message: String

Actionable model setup error.

§

CompactionModelStream

Compaction model stream failed or returned an invalid candidate shape.

Fields

§message: String

Actionable model stream error.

§

AgentRunHookInvocationPending

A host-bridged hook invocation is still pending and must be resolved before reading further messages.

Fields

§session_id: SessionId

Session whose run has a pending hook invocation.

§invocation_id: HookInvocationId

Pending hook invocation identifier.

§

NoPendingAgentRunHookInvocation

A caller attempted to submit a hook decision when no hook invocation is pending.

Fields

§session_id: SessionId

Session whose run has no pending hook invocation.

§

HookInvocationIdMismatch

A submitted hook decision referenced the wrong invocation identifier.

Fields

§session_id: SessionId

Session whose run rejected the hook decision.

§expected_invocation_id: HookInvocationId

Active hook invocation identifier.

§received_invocation_id: HookInvocationId

Identifier submitted by the caller.

§

HookFailed

A lifecycle hook failed (fail-closed).

Fields

§session_id: SessionId

Session whose hook failed.

§hook_point: HookPoint

Hook point that failed.

§message: String

Actionable failure detail.

§

HookCancelled

A lifecycle hook was cancelled cooperatively.

Fields

§session_id: SessionId

Session whose hook was cancelled.

§hook_point: HookPoint

Hook point that was cancelled.

Implementations§

Source§

impl RuntimeError

Source

pub const fn diagnostic_code(&self) -> &'static str

Returns the stable provider-neutral code for this runtime failure.

Source

pub fn is_retryable_bridge_tool_result(&self) -> bool

Returns whether a bridge result error can be corrected by resubmitting the same active batch. This classification is shared by runtime and language bindings so a binding cannot terminate a run on a validation error that the host is expected to fix.

Trait Implementations§

Source§

impl Debug for RuntimeError

Source§

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

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

impl Display for RuntimeError

Source§

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

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

impl Error for RuntimeError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CheckpointError> for RuntimeError

Source§

fn from(source: CheckpointError) -> RuntimeError

Converts to this type from the input type.
Source§

impl From<CompactionError> for RuntimeError

Source§

fn from(source: CompactionError) -> RuntimeError

Converts to this type from the input type.
Source§

impl From<ContextError> for RuntimeError

Source§

fn from(source: ContextError) -> RuntimeError

Converts to this type from the input type.
Source§

impl From<CoreError> for RuntimeError

Source§

fn from(source: CoreError) -> RuntimeError

Converts to this type from the input type.
Source§

impl From<PlanError> for RuntimeError

Source§

fn from(source: PlanError) -> RuntimeError

Converts to this type from the input type.
Source§

impl From<RuntimeError> for InteractiveError

Source§

fn from(source: RuntimeError) -> InteractiveError

Converts to this type from the input type.
Source§

impl From<RuntimeError> for AgentBuildError

Source§

fn from(source: RuntimeError) -> Self

Converts to this type from the input type.
Source§

impl From<RuntimeError> for AgentError

Source§

fn from(source: RuntimeError) -> Self

Converts to this type from the input type.
Source§

impl From<SessionStoreError> for RuntimeError

Source§

fn from(source: SessionStoreError) -> RuntimeError

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for RuntimeError

§

impl !UnwindSafe for RuntimeError

§

impl Forget for RuntimeError

§

impl Freeze for RuntimeError
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, &'static str: Freeze, PhantomData<ToolCallId>: Freeze, *const () is !null: Freeze, PhantomData<ErrorData<CustomOwner>>: Freeze, *const ErrorImpl is !null: Freeze, PhantomData<ErrorImpl>: Freeze,

§

impl Move for RuntimeError

§

impl Send for RuntimeError
where RawVecInner: Send, &'static str: Send, Repr: Send, BoxRaw<ErrorImpl>: Send,

§

impl Sync for RuntimeError
where RawVecInner: Sync, Repr: Sync, BoxRaw<ErrorImpl>: Sync,

§

impl Unpin for RuntimeError
where *const u8 is !null: Unpin, &'static str: Unpin, *const () is !null: Unpin, &'static SimpleMessage: Unpin, *const Custom is !null: Unpin, Box<ErrorImpl>: Unpin,

§

impl UnsafeUnpin for RuntimeError
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, &'static str: UnsafeUnpin, PhantomData<ToolCallId>: UnsafeUnpin, *const () is !null: UnsafeUnpin, PhantomData<ErrorData<CustomOwner>>: UnsafeUnpin, *const ErrorImpl is !null: UnsafeUnpin, PhantomData<ErrorImpl>: UnsafeUnpin,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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