Skip to content

[FEATURE] Configurable retry strategies with exception filtering #1597

@nagabharann

Description

@nagabharann

Problem Statement

Current retry behavior treats all failures as retriable. There is no ability to define specific exceptions or criteria for when to retry versus when to fail immediately. This leads to wasted retries on non-recoverable errors and delayed failure reporting.

Proposed Solution

Provide configurable retry strategies:

  1. Exception allowlist/denylist for retriable errors
  2. Custom retry predicates (e.g., should_retry(exception) -> bool)
  3. Per-tool or per-model retry configuration
  4. Configurable backoff strategies

Use Case

In production workloads:

  1. Retry on transient network errors (ConnectionError, Timeout)
  2. Do not retry on authentication failures (403, 401)
  3. Do not retry on validation errors (400)
  4. Custom retry logic for domain-specific exceptions

Alternatives Solutions

We implement retry logic in our hooks, but native support would be cleaner and more consistent.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-providerRelated to model providersenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions