Skip to content

[BUG] retry_strategy=None should turn off retries #1579

@mkmeral

Description

@mkmeral

Problem Statement

Currently, in order to disable retry strategy, you need to set max attempts to 1.

Also setting retry strategy to None is equal to the default behavior where we retry models.

    from strands import Agent, ModelRetryStrategy

    agent = Agent(
        retry_strategy=ModelRetryStrategy(max_attempts=1)
    )

Proposed Solution

This is not intuitive, and not a good DevX. As a developer, I'd expect retry_strategy=None to be no retries.

Instead the default should be

def __call__(retry_strategy=ModelRetryStrategy(max_attempts=MAX_ATTEMPTS, max_delay=MAX_DELAY, initial_delay=INITIAL_DELAY)):
    ...

And retry_strategy=None should disable it.

Use Case

DevX

Alternatives Solutions

No response

Additional Context

As we have already released this, changing is backwards incompatible. As a result, we will fix/improve this in v2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions