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.
SessionClosed
An operation was requested on a runtime whose session has already been closed.
InvalidStepInput
Step input failed runtime validation.
AgentLoopConfig
An agent-loop entry point received conflicting structured-output contracts from its context and loop configuration.
Fields
source: AgentLoopConfigErrorInvalid loop configuration detail.
ChildRuntimeBuild
A child runtime factory could not materialize its runtime profile.
InvalidSubagentSelection
A subagent status operation did not select any child agents.
Plan
A Plan Mode operation failed validation or referenced an unknown plan.
InvalidUserImageInput
A user image or image-bearing message failed runtime validation.
UnknownToolCall
A submitted tool result does not match any pending or resolved call.
Fields
call_id: ToolCallIdTool call id that could not be found.
BridgeToolResultBatchEmpty
A bridge result submission did not contain any outcomes.
BridgeToolResultBatchMismatch
A bridge result submission did not resolve exactly the requested calls.
Fields
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
expected_batch_id: ToolCallBatchIdRuntime-owned batch id currently awaiting results.
received_batch_id: ToolCallBatchIdBatch 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
AgentRunToolInvocationsPending
The run cannot read another message until its current host batch is resolved.
Fields
batch_id: ToolCallBatchIdBatch that must be resolved first.
NoPendingAgentRunToolInvocations
A host submitted results when the run has no active host batch.
ToolCallAlreadyResolved
A tool result was submitted after the call had already been resolved.
Fields
call_id: ToolCallIdTool call id that already has a result.
DuplicateToolRegistration
Runtime construction tried to register the same tool name more than once.
ReservedToolName
Runtime-reserved provider-visible tool name was registered by an application.
InvalidToolInputSchema
Runtime construction received a tool schema that JSON Schema validation cannot compile.
Fields
BridgeToolsNotAllowed
Runtime construction tried to register a bridge tool without explicit opt-in.
ToolExecutionCancelled
Tool execution was cancelled before producing a durable result.
Fields
call_id: ToolCallIdTool call id that remained pending.
ToolExecutionFailed
Tool executor infrastructure failed before producing a durable result.
Fields
call_id: ToolCallIdTool call id that remained pending.
AgentRunClosed
A runtime-owned agent run stopped before producing a terminal result.
Fields
MissingActionExecutionEvidence
An admitted mutating action reported success without internal execution evidence.
Fields
call_id: ToolCallIdTool call id that remained pending.
action_kind: ToolActionKindAction kind that required internal execution evidence.
MutatingActionCommitLifecycleRequired
A mutating action reached the generic executor path before a commit lifecycle exists.
Fields
call_id: ToolCallIdTool call id that remained pending.
action_kind: ToolActionKindMutating action kind that must use a commit lifecycle.
UnsupportedToolResultContent
A tool result used invalid or blank output content.
Fields
call_id: ToolCallIdTool call identifier for the submitted tool result.
output_kind: ToolOutputKindSubmitted 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.
InvalidModelTurnTransition
A transcript mutation attempted to change a terminal or incompatible turn.
TranscriptToolCallMissing
A pending tool call was not represented in the durable transcript.
Fields
call_id: ToolCallIdCore
A core protocol value could not be constructed.
Context
Context state could not be constructed or compiled.
Fields
source: ContextErrorSource context error.
Checkpoint
Checkpoint state could not be inspected or validated.
Fields
source: CheckpointErrorSource checkpoint error.
Compaction
Compaction state could not be constructed or applied.
Fields
source: CompactionErrorSource compaction error.
SessionStore
Session persistence failed.
Fields
source: SessionStoreErrorSource session store error.
MissingModelProvider
A runtime operation needed a model provider for a role that is not configured.
CompactionModelRequest
Compaction model request construction failed.
CompactionModelWindowTooSmall
The configured compaction model cannot accept the primary model’s context window.
Fields
CompactionModelRequestTooLarge
The compiled compaction request cannot hold its input and reserved output together.
Fields
CompactionModelTruncated
The compaction model stopped before it produced a complete checkpoint.
CompactionModelSetup
Compaction model setup failed before a stream was returned.
CompactionModelStream
Compaction model stream failed or returned an invalid candidate shape.
AgentRunHookInvocationPending
A host-bridged hook invocation is still pending and must be resolved before reading further messages.
Fields
invocation_id: HookInvocationIdPending hook invocation identifier.
NoPendingAgentRunHookInvocation
A caller attempted to submit a hook decision when no hook invocation is pending.
HookInvocationIdMismatch
A submitted hook decision referenced the wrong invocation identifier.
Fields
expected_invocation_id: HookInvocationIdActive hook invocation identifier.
received_invocation_id: HookInvocationIdIdentifier submitted by the caller.
HookFailed
A lifecycle hook failed (fail-closed).
Fields
HookCancelled
A lifecycle hook was cancelled cooperatively.
Implementations§
Source§impl RuntimeError
impl RuntimeError
Sourcepub const fn diagnostic_code(&self) -> &'static str
pub const fn diagnostic_code(&self) -> &'static str
Returns the stable provider-neutral code for this runtime failure.
Sourcepub fn is_retryable_bridge_tool_result(&self) -> bool
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
impl Debug for RuntimeError
Source§impl Display for RuntimeError
impl Display for RuntimeError
Source§impl Error for RuntimeError
impl Error for RuntimeError
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()