Skip to content

Conversation

@patricklundquist
Copy link
Contributor

Implements an automatic retry mechanism for OpenAI API calls to handle transient httpx.ConnectError exceptions.

  • Adds tenacity as a dependency.
  • Wraps all OpenAI API calls in OpenAIModelClass with a @retry decorator.
  • Configures the retry to happen up to 3 times with exponential backoff on httpx.ConnectError.

Implements an automatic retry mechanism for OpenAI API calls to handle transient `httpx.ConnectError` exceptions.

- Adds `tenacity` as a dependency.
- Wraps all OpenAI API calls in `OpenAIModelClass` with a `@retry` decorator.
- Configures the retry to happen up to 3 times with exponential backoff on `httpx.ConnectError`.
@patricklundquist
Copy link
Contributor Author

@copilot, fix tests

Copy link
Contributor

Copilot AI commented Dec 17, 2025

@patricklundquist I've opened a new pull request, #879, to work on those changes. Once the pull request is ready, I'll request review from you.

…879)

* Initial plan

* Fix tests: Add missing mock methods to MockOpenAIClient

Add models.list(), images.generate(), and embeddings.create() mock methods to MockOpenAIClient to support the retry logic that was added to OpenAIModelClass.

Co-authored-by: patricklundquist <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: patricklundquist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants