pub enum ErrorDomain {
Planning,
Reflection,
Action,
System,
}Expand description
High-level error domain for recovery strategy dispatch.
Groups the 11 ToolErrorCategory variants into 4 domains that map to distinct
recovery strategies in the agent loop. Does NOT replace ToolErrorCategory — it
is a companion abstraction for coarse dispatch.
Variants§
Planning
The agent selected the wrong tool or misunderstood the task.
Recovery: re-plan, pick a different tool or approach.
Categories: ToolNotFound
Reflection
The agent’s output (parameters, types) was malformed.
Recovery: reformat parameters using tool schema, retry once.
Categories: InvalidParameters, TypeMismatch
Action
External action failed due to policy or resource constraints.
Recovery: inform user, suggest alternative, or skip.
Categories: PolicyBlocked, ConfirmationRequired, PermanentFailure, Cancelled
System
Transient infrastructure failure.
Recovery: automatic retry with backoff.
Categories: RateLimited, ServerError, NetworkError, Timeout
Implementations§
Source§impl ErrorDomain
impl ErrorDomain
Sourcepub fn is_auto_retryable(self) -> bool
pub fn is_auto_retryable(self) -> bool
Whether errors in this domain should trigger automatic retry.
Sourcepub fn needs_llm_correction(self) -> bool
pub fn needs_llm_correction(self) -> bool
Whether the LLM should be asked to fix its output.
Trait Implementations§
Source§impl Clone for ErrorDomain
impl Clone for ErrorDomain
Source§fn clone(&self) -> ErrorDomain
fn clone(&self) -> ErrorDomain
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more