fix: increase OpenAI client max_retries to handle 429 rate limits#245
Merged
gvanrossum merged 1 commit intomicrosoft:mainfrom Apr 23, 2026
Merged
Conversation
The default max_retries=2 is too low for bursty workloads. Bump to 5 across all four AsyncOpenAI/AsyncAzureOpenAI construction sites so the built-in exponential backoff handles transient 429s.
3 tasks
gvanrossum
pushed a commit
that referenced
this pull request
Apr 23, 2026
## Summary - Adds 3 tests for `resolve_azure_model_name` covering: deployment name extraction from endpoint, fallback to provided model name, and default `AZURE_OPENAI_ENDPOINT` envvar usage - Fixes `test_create_embedding_model_uses_azure_deployment_name` — wasn't clearing `OPENAI_EMBEDDING_MODEL` from the environment, so the assertion failed when that envvar was set - Addresses review comment from #241 ## Test plan - [x] `make check` (pyright) — 0 errors - [x] `pytest tests/test_utils.py tests/test_model_adapters.py` — 33/33 pass - [x] `make test` — 496 pass, 3 fail (all transient 429 rate limits, addressed in #245)
gvanrossum
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
max_retriesfrom the default (2) to 5 across all fourAsyncOpenAI/AsyncAzureOpenAIconstruction sites (create_async_openai_clientand_make_azure_provider)test_ingest_podcast,test_query_method_basic,test_transcript_knowledge_extraction_slow) were failing intermittently due to 429sTest plan
make check(pyright) — 0 errorspytest tests/test_model_adapters.py tests/test_utils.py— 29/30 pass (1 pre-existing failure fixed in test: add tests for resolve_azure_model_name #244)