pub enum ToolErrorCategory {
ToolNotFound,
InvalidParameters,
TypeMismatch,
PolicyBlocked,
ConfirmationRequired,
PermanentFailure,
Cancelled,
RateLimited,
ServerError,
NetworkError,
Timeout,
}Expand description
Fine-grained 12-category classification of tool invocation errors.
Each category determines retry eligibility, LLM parameter reformat path, quality attribution for reputation scoring, and structured feedback content.
Variants§
ToolNotFound
Tool name not found in the registry (LLM requested a non-existent tool).
InvalidParameters
LLM provided invalid or missing parameters for the tool.
TypeMismatch
Parameter type mismatch (e.g., string where integer expected).
PolicyBlocked
Blocked by security policy (blocklist, sandbox, trust gate).
ConfirmationRequired
Requires user confirmation before execution.
PermanentFailure
HTTP 403/404 or equivalent permanent resource rejection.
Cancelled
Operation cancelled by the user.
RateLimited
HTTP 429 (rate limit) or resource exhaustion.
ServerError
HTTP 5xx or equivalent server-side error.
NetworkError
Network connectivity failure (DNS, connection refused, reset).
Timeout
Operation timed out.
Implementations§
Source§impl ToolErrorCategory
impl ToolErrorCategory
Sourcepub fn is_retryable(self) -> bool
pub fn is_retryable(self) -> bool
Whether this error category is eligible for automatic retry with backoff.
Sourcepub fn needs_parameter_reformat(self) -> bool
pub fn needs_parameter_reformat(self) -> bool
Whether the LLM should be asked to reformat parameters and retry.
Only InvalidParameters and TypeMismatch trigger the reformat path.
A single reformat attempt is allowed; if it fails, the error is final.
Sourcepub fn is_quality_failure(self) -> bool
pub fn is_quality_failure(self) -> bool
Whether this error is attributable to LLM output quality.
Quality failures affect reputation scoring in triage routing and are the
only category for which attempt_self_reflection should be triggered.
Infrastructure errors (network, timeout, server, rate limit) are NOT
the model’s fault and must never trigger self-reflection.
Sourcepub fn domain(self) -> ErrorDomain
pub fn domain(self) -> ErrorDomain
Map to the high-level error domain for recovery dispatch.
Use the returned ErrorDomain to select a recovery strategy in the agent loop
instead of checking multiple predicate methods individually.
Sourcepub fn error_kind(self) -> ErrorKind
pub fn error_kind(self) -> ErrorKind
Coarse classification for backward compatibility with existing ErrorKind.
Sourcepub fn phase(self) -> ToolInvocationPhase
pub fn phase(self) -> ToolInvocationPhase
Map to the diagnostic invocation phase per arXiv:2601.16280.
Sourcepub fn label(self) -> &'static str
pub fn label(self) -> &'static str
Human-readable label for audit logs, TUI status indicators, and structured feedback.
Sourcepub fn suggestion(self) -> &'static str
pub fn suggestion(self) -> &'static str
Recovery suggestion for the LLM based on error category.
Trait Implementations§
Source§impl Clone for ToolErrorCategory
impl Clone for ToolErrorCategory
Source§fn clone(&self) -> ToolErrorCategory
fn clone(&self) -> ToolErrorCategory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more