Skip to content

Automatic retry logic - #122

Merged
tombch merged 5 commits into
developmentfrom
automatic-retry
Feb 13, 2026
Merged

Automatic retry logic#122
tombch merged 5 commits into
developmentfrom
automatic-retry

Conversation

@tombch

@tombch tombch commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automatic retry behavior to the Python Onyx client so transient gateway/service failures (502/503/504) are retried with exponential backoff, addressing #121.

Changes:

  • Configure a requests.Session with an HTTPAdapter + Retry strategy and use it both inside and outside the client context manager.
  • Add unit tests asserting retry adapter configuration and verifying retry behavior.
  • Add responses to the dev/test optional dependency groups.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
onyx/core.py Introduces retry constants and configures a retry-enabled requests.Session; updates context manager behavior to use the configured session.
tests/test_api.py Adds tests to validate retry configuration and runtime retry behavior.
pyproject.toml Adds responses as a test/dev dependency to support the new retry tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread onyx/core.py
Comment thread onyx/core.py
Comment thread onyx/core.py
Comment thread tests/test_api.py
Comment thread tests/test_api.py

@tombch tombch left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tombch
tombch merged commit 1be0c83 into development Feb 13, 2026
5 checks passed
@tombch
tombch deleted the automatic-retry branch February 13, 2026 11:11
@tombch tombch mentioned this pull request Feb 13, 2026
tombch added a commit that referenced this pull request Feb 13, 2026
* Automatic retry logic (#122)

* Automatic retry logic

* Always set to None

* Removed 429 too many requests from retry

* Raising OnyxServerError for 502-504

* Version bump

* Version bump
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.

2 participants