pub enum AgentError {
Show 14 variants
RateLimit {
message: String,
},
Auth {
message: String,
},
ModelUnavailable {
message: String,
model: String,
},
ContextOverflow {
message: String,
},
Timeout {
elapsed: Duration,
},
MissingTool {
tool: String,
},
PermissionDenied {
message: String,
},
WaitingForInput {
message: String,
},
StaleSession {
session_id: String,
},
InvalidResponse {
raw: String,
},
AgentFailed {
message: String,
},
NetworkError {
message: String,
},
ThinkingBlockConflict {
message: String,
},
Unknown {
exit_code: i32,
message: String,
},
}Expand description
Agent-specific error with enough detail for autonomous recovery.
Variants§
RateLimit
Rate/usage limit — reroute to different agent, cooldown current.
Auth
Auth/billing/API key error — switch agent entirely.
Requested model not available — try different model, then switch agent.
ContextOverflow
Context window exceeded — truncate and retry, then switch agent.
Timeout
Agent timed out — retry once, then switch agent.
MissingTool
Required tool/binary missing from the environment.
PermissionDenied
Sandbox or filesystem permission denied.
WaitingForInput
Agent is waiting for interactive input (e.g., 1Password, SSH).
StaleSession
The agent’s session ID is no longer valid (session expired or was cleared).
Returned when Claude reports “No conversation found with session ID: --session-id.
InvalidResponse
Agent returned unparseable output.
AgentFailed
Agent self-reported a failure in its response.
NetworkError
Transient network connectivity error — retry same agent, no failover.
ThinkingBlockConflict
Thinking blocks cannot be modified (Claude extended-thinking + tool-use 400).
Transient API incompatibility inside the Claude CLI’s multi-turn tool-use loop — the Anthropic API rejects the request when thinking blocks are altered between turns. Not a model capacity problem: does NOT increment failure counts or apply cooldowns. The task is rerouted to a different agent.
Unknown
Unclassified error.
Trait Implementations§
Source§impl Clone for AgentError
impl Clone for AgentError
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()
Auto Trait Implementations§
impl Freeze for AgentError
impl RefUnwindSafe for AgentError
impl Send for AgentError
impl Sync for AgentError
impl Unpin for AgentError
impl UnsafeUnpin for AgentError
impl UnwindSafe for AgentError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.