pub trait RetryPolicyCoreExt {
// Required methods
fn decision_for_vtcode_error(
&self,
error: &VtCodeError,
attempt_index: u32,
tool_name: Option<&str>,
) -> RetryDecision;
fn decision_for_anyhow(
&self,
error: &Error,
attempt_index: u32,
tool_name: Option<&str>,
) -> RetryDecision;
fn decision_for_llm_error(
&self,
error: &LLMError,
attempt_index: u32,
) -> RetryDecision;
fn decision_for_tool_error(
&self,
error: &UnifiedToolError,
attempt_index: u32,
) -> RetryDecision;
fn decision_for_tool_execution_error(
&self,
error: &ToolExecutionError,
attempt_index: u32,
) -> RetryDecision;
fn step_for_vtcode_error(
&self,
error: VtCodeError,
attempt_index: u32,
tool_name: Option<&str>,
) -> RetryStep;
fn apply_to_tool_execution_error(
&self,
error: ToolExecutionError,
attempt_index: u32,
tool_name: Option<&str>,
) -> ToolExecutionError;
}Expand description
Domain-aware retry decisions layered over the shared RetryPolicy.
Import this trait to call the decision_for_* / step_for_* methods on
a policy; the policy struct itself is defined in vtcode-commons.
Required Methods§
fn decision_for_vtcode_error( &self, error: &VtCodeError, attempt_index: u32, tool_name: Option<&str>, ) -> RetryDecision
fn decision_for_anyhow( &self, error: &Error, attempt_index: u32, tool_name: Option<&str>, ) -> RetryDecision
fn decision_for_llm_error( &self, error: &LLMError, attempt_index: u32, ) -> RetryDecision
fn decision_for_tool_error( &self, error: &UnifiedToolError, attempt_index: u32, ) -> RetryDecision
fn decision_for_tool_execution_error( &self, error: &ToolExecutionError, attempt_index: u32, ) -> RetryDecision
Sourcefn step_for_vtcode_error(
&self,
error: VtCodeError,
attempt_index: u32,
tool_name: Option<&str>,
) -> RetryStep
fn step_for_vtcode_error( &self, error: VtCodeError, attempt_index: u32, tool_name: Option<&str>, ) -> RetryStep
Classify a VtCodeError failure into a typed RetryStep.
This consolidates the “decision -> sleep or give-up” branching used by
agent-level retry loops, removing the brittle
decision.delay.expect("retryable decisions need delay") calls and
guaranteeing a delay is always available for retryable steps.
fn apply_to_tool_execution_error( &self, error: ToolExecutionError, attempt_index: u32, tool_name: Option<&str>, ) -> ToolExecutionError
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".