Skip to content

Add support for additional retry policy parameters to Python SDK ctx.runΒ #67

@ouatu-ro

Description

@ouatu-ro

This PR proposes expanding retry policy support in the Python SDK to more closely match the TypeScript SDK.

Currently, the Python SDK supports:

  • max_attempts
  • max_retry_duration

The TypeScript SDK supports additional parameters:

const myRunRetryPolicy = {
  initialRetryIntervalMillis: 500,
  retryIntervalFactor: 2,
  maxRetryIntervalMillis: 1000,
  maxRetryAttempts: 5,
  maxRetryDurationMillis: 1000,
}

To provide similar flexibility in retry behavior for Python users, I suggest we consider adding the following parameters:

  • initial_retry_interval (config.initial_interval already exists in the code, but not exposed)
  • retry_interval_factor
  • max_retry_interval

These would allow users to more finely control backoff behavior and align feature parity across SDKs.

If this is not currently planned, I'm happy to contribute an implementation or build a wrapper if needed. Let me know what direction makes most sense.

Aditional question:

  • Would you consider clarifying whether max_retry_duration is measured across all attempts of a single ctx.run() call, or across multiple calls?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions