Skip to content

feat(clients): add opt-in retry with backoff for transient failures - #1669

Open
tharunsridhar wants to merge 1 commit into
caura-ai:mainfrom
tharunsridhar:feat/client-retry-backoff
Open

tharunsridhar wants to merge 1 commit into
caura-ai:mainfrom
tharunsridhar:feat/client-retry-backoff

Conversation

@tharunsridhar

Copy link
Copy Markdown

Add retries and retry_backoff constructor params to the Python client. Off by default (retries=0), so existing behavior is unchanged.

When enabled, read methods (search, recall, health, get_document) retry on transport errors and HTTP 429/502/503/504, using the Retry-After header when the server sends one and exponential backoff otherwise. Other 4xx responses are never retried. write() and submit_interview() are excluded by default to avoid duplicating a write whose result is unknown.

Closes #551

Summary

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Documentation update
  • Refactor / internal cleanup
  • Other:

How Has This Been Tested?

Checklist

  • I have read CONTRIBUTING.md
  • I have added tests that cover my changes (or explained why none are needed)
  • ruff check and ruff format --check pass
  • mypy passes
  • pytest passes locally
  • I have updated relevant documentation (README, docs, etc.)
  • I have updated CHANGELOG.md under the Unreleased section (if user-facing)

Additional Notes

Add retries and retry_backoff constructor params to the Python client.
Off by default (retries=0), so existing behavior is unchanged.

When enabled, read methods (search, recall, health, get_document) retry
on transport errors and HTTP 429/502/503/504, using the Retry-After
header when the server sends one and exponential backoff otherwise.
Other 4xx responses are never retried. write() and submit_interview()
are excluded by default to avoid duplicating a write whose result is
unknown.

Closes caura-ai#551

Signed-off-by: Tharun Sridhar <tharunsridhar@gmail.com>
@tharunsridhar
tharunsridhar requested a review from a team as a code owner September 21, 2026 16:31

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(client-python): opt-in retry with backoff for transient failures (429/502/503/504)

1 participant