#[non_exhaustive]pub enum AgentError {
Show 30 variants
Llm {
provider: &'static str,
reason: LlmFailureReason,
message: String,
},
StoreError(String),
ToolError(String),
McpError(String),
SessionNotFound(SessionId),
TokenBudgetExceeded {
used: u64,
limit: u64,
},
TimeBudgetExceeded {
elapsed_secs: u64,
limit_secs: u64,
},
ToolCallBudgetExceeded {
count: usize,
limit: usize,
},
MaxTokensReached {
turn: u32,
partial: String,
},
ContentFiltered {
turn: u32,
},
MaxTurnsReached {
turns: u32,
},
Cancelled,
InvalidStateTransition {
from: String,
to: String,
},
OperationNotFound(String),
DepthLimitExceeded {
depth: u32,
max: u32,
},
ConcurrencyLimitExceeded,
ConfigError(String),
InvalidToolAccess {
tool: String,
},
InternalError(String),
BuildError(String),
AuthReauthRequired {
binding_key: String,
message: String,
},
CallbackPending {
tool_name: String,
args: Value,
},
StructuredOutputValidationFailed {
attempts: u32,
reason: String,
last_output: String,
},
InvalidOutputSchema(String),
HookDenied {
hook_id: HookId,
point: HookPoint,
reason_code: HookReasonCode,
message: String,
payload: Option<Value>,
},
HookTimeout {
hook_id: HookId,
timeout_ms: u64,
},
HookExecutionFailed {
hook_id: HookId,
reason: String,
},
HookConfigInvalid {
reason: String,
},
TerminalFailure {
outcome: TurnTerminalOutcome,
cause_kind: TurnTerminalCauseKind,
message: String,
},
NoPendingBoundary,
}Expand description
Errors that can occur during agent execution
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Llm
StoreError(String)
ToolError(String)
McpError(String)
SessionNotFound(SessionId)
TokenBudgetExceeded
TimeBudgetExceeded
ToolCallBudgetExceeded
MaxTokensReached
ContentFiltered
MaxTurnsReached
Cancelled
InvalidStateTransition
OperationNotFound(String)
DepthLimitExceeded
ConcurrencyLimitExceeded
ConfigError(String)
InvalidToolAccess
InternalError(String)
BuildError(String)
Agent construction failed (e.g. missing API key, unknown provider).
AuthReauthRequired
MeerkatMachine DSL observed an auth lease in reauth_required
state at a CallingLlm boundary; the lease cannot proceed
until the user re-authenticates (rkat auth login). This is a
machine-owned terminal class (Phase 1.5-rev), distinct from
AgentError::InternalError which is for genuinely
unexpected failures.
CallbackPending
A tool call must be routed externally (callback pending)
StructuredOutputValidationFailed
Structured output validation failed after retries
InvalidOutputSchema(String)
Invalid output schema provided
HookDenied
Fields
reason_code: HookReasonCodeHookTimeout
HookExecutionFailed
HookConfigInvalid
TerminalFailure
Turn execution reached a terminal outcome classified as HardFailure.
NoPendingBoundary
The session has no pending user/tool-results boundary for run_pending.
Returned when RuntimeExecutionKind::ResumePending is requested but the
session’s last message is not User or ToolResults. The caller should
treat this as a successful no-op (no turn ran, no output produced).
Implementations§
Source§impl AgentError
impl AgentError
pub fn llm( provider: &'static str, reason: LlmFailureReason, message: impl Into<String>, ) -> Self
pub fn is_graceful(&self) -> bool
pub fn is_rate_limited(&self) -> bool
pub fn retry_after_hint(&self) -> Option<Duration>
pub fn is_recoverable(&self) -> bool
Trait Implementations§
Source§impl Debug for AgentError
impl Debug for AgentError
Source§impl Display for AgentError
impl Display for AgentError
Source§impl Error for AgentError
impl Error for AgentError
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()