Skip to main content

ToolErrorRecovery

Trait ToolErrorRecovery 

Source
pub trait ToolErrorRecovery: Send + Sync {
    // Required method
    fn on_error(
        &self,
        _session_id: &SessionId,
        _tool_names: &[String],
        _error: &AgentError,
    ) -> AgentResult<ToolErrorAction>;
}
Expand description

Recovery strategy after a tool execution failure

Defaults to StopOnError, following the lightweight kernel design of conservative defaults and strategy injection. Upper-layer agents can inject custom strategies such as RetryOnError.

Required Methods§

Source

fn on_error( &self, _session_id: &SessionId, _tool_names: &[String], _error: &AgentError, ) -> AgentResult<ToolErrorAction>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§