#[non_exhaustive]pub enum Error {
Show 20 variants
Llm {
provider: String,
message: String,
},
RateLimited {
provider: String,
retry_after_ms: u64,
},
Tool {
name: String,
call_id: Option<String>,
message: String,
},
BadToolArgs {
name: String,
message: String,
},
ToolRejected {
name: String,
reason: String,
},
UnknownTool(String),
PermissionDenied {
name: String,
reason: DecisionReason,
},
PermissionDeniedLimit {
name: String,
},
ProviderTruncated(String),
Mcp {
server: String,
message: String,
},
Config {
message: String,
},
Io(Error),
Http(Error),
Json(Error),
Cancelled,
Timeout {
duration_ms: u64,
},
Storage {
message: String,
},
NotFound(String),
SchemaTooNew {
session_id: String,
found: u32,
supported: u32,
},
Internal {
context: String,
message: String,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Llm
LLM provider returned an error (HTTP, parse, etc.)
RateLimited
LLM rate limited — caller should retry after retry_after_ms
Tool
Tool execution failure (spawn, timeout, I/O)
call_id links this error back to the tool_call_id of the triggering
ToolCall, enabling audit logs and session persistence to correlate the
failure with the exact turn that requested the tool.
Fields
BadToolArgs
Invalid arguments passed to a tool
ToolRejected
Tool rejected execution (policy, constraints, safety)
UnknownTool(String)
Tool not found in registry
PermissionDenied
Permission denied for a tool call
PermissionDeniedLimit
Auto-classifier denial limit exceeded — agent should stop
ProviderTruncated(String)
LLM response truncated by provider
Mcp
MCP protocol/transport error
Config
Configuration error (missing env var, invalid value)
Io(Error)
I/O error
Http(Error)
HTTP client error
Json(Error)
JSON serialization/deserialization error
Cancelled
Operation cancelled via CancellationToken.
Timeout
Timeout after a specified duration
Storage
Storage backend error (I/O, serialization, remote storage, etc.)
NotFound(String)
A named resource (team, task, etc.) was requested but does not exist.
SchemaTooNew
Session metadata on disk has a schema_version newer than this
build of the binary knows how to interpret. Raised by
SessionReader::load_meta when it sees a version greater than
the supported maximum — the safe action is to refuse to load
the session, not to silently drop fields.
Internal
Internal agent error — unexpected state that does not map to any typed
variant. Prefer a specific variant; use Internal only as last resort.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if the error is safe to retry (rate limits, timeouts).
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns true if the error is transient (network issues, timeouts).
Transient errors may resolve without changing the request.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()