crewAIInc / crewAIInc/crewAI

Add configurable retry-with-backoff for tool execution failures

Open
#7,460 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Python
Stars
58.8k
Forks
8.5k
Avg merge
1d 15h
Merged PRs (30d)
109

Description

Feature Area

Integration with external tools

Is your feature request related to a an existing bug? Please link it here.

NA

Describe the solution you'd like

Currently, when a tool execution fails because of a transient error such as a timeout, rate limit, or temporary network failure, the failure can propagate immediately.

I would like to propose an optional retry mechanism for tool execution with exponential backoff.

The feature could provide configuration such as:

  • max_retries: maximum number of retry attempts.
  • backoff_factor: controls the delay between retry attempts.

For example, with max_retries=3, a failed tool could be retried up to three times before the original exception is raised.

The default could remain 0 retries to preserve backward compatibility.

The retry behavior should be isolated and testable, and ideally should only retry appropriate transient failures rather than every possible exception.

Describe alternatives you've considered

One alternative is for individual tools or users to implement their own retry logic.

However, this can lead to duplicated retry implementations across tools and inconsistent behavior.

A centralized, optional retry mechanism would provide a consistent approach while allowing users to disable retries by keeping the default at zero.

Additional context

This feature would be particularly useful when CrewAI agents interact with external APIs and services where temporary failures are common.

Example:

Agent → Tool → External API → timeout

Instead of immediately failing, the tool execution could retry:

Attempt 1 → failure → wait → retry
Attempt 2 → failure → wait longer → retry
Attempt 3 → success

The exact API and implementation details can be discussed with the maintainers before implementation.

Willingness to Contribute

Yes, I'd be happy to submit a pull request

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the tool execution path and reviewing how timeout, rate-limit, and network exceptions are currently propagated. Clarify the configuration API, retryable failure types, and backoff behavior with maintainers, then add focused tests showing retries, delays, default zero retries, and final exception propagation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.