Repository navigation
fix(python-sdk): accept older openai and anthropic releases - #409
Open
czi-fsisenda wants to merge 6 commits into
Open
czi-fsisenda wants to merge 6 commits into
czi-fsisenda wants to merge 6 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ropic 2.x The floors were where openai and anthropic moved to the httpx2 transport, not the oldest versions the adapters work with. That forced callers pinned to an older release out of the package. They are now the oldest versions the suite, including the new wire-level adapter tests, passes on: - openai >=2.0.0 (was 2.47.0): the first to export `omit` - anthropic >=0.77.0 (was 1.0.0): the first whose `messages.create` takes `output_config` - google-genai stays at 1.39.0: the first with Client.close/aclose The anthropic cap moves to <3. The suite and mypy pass on anthropic 2.3, openai 3.42 and google-genai 2.34. The `dev` extra now declares httpx2, which the tests use to build vendor errors and which nothing else installs at the new floors. A new CI job, "Lowest vendor SDKs", installs each SDK at the bound pyproject.toml declares and runs the tests, so the floors stay accurate. Refs: DSCR-2625 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the Python SDK vendor compatibility changes.
No open issues 🎉
What changed in this PR
This PR widens Python SDK vendor compatibility so callers pinned to older releases can install the package without adapter changes. It adds compatibility tests and CI coverage to validate the supported minimum versions.
Changes:
- Lowers the OpenAI minimum to 2.0.0 and Anthropic minimum to 0.77.0, while allowing Anthropic 2.x.
- Tests real vendor clients over mocked HTTP transports, covering requests, responses, errors, attachments, and client lifecycle.
- Adds a CI job that installs vendor SDKs at their declared minimum versions and runs the tests.
| File | Description |
|---|---|
sdks/python/tests/unit/providers/test_vendor_sdk_wire.py |
Adds transport-level compatibility tests for all three vendor adapters. |
sdks/python/pyproject.toml |
Widens vendor version ranges and adds httpx2 as a development dependency. |
.github/workflows/test-sdk-python.yml |
Adds test coverage against the declared minimum vendor SDK versions. |
Review effort: Balanced
1.108.1 is the first openai release to export `omit`, so it is the real floor. The search behind the previous floor of 2.0.0 sampled 1.99.9 and 2.0.0 and nothing between them. The full suite passes on 1.108.1 with anthropic 0.77.0 and google-genai 1.39.0, and mypy is clean on `src/`. The range now covers a partner on openai 1.109.1. Refs: DSCR-2625 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anthropic 2.0 moved its default `anthropic-version` header from 2023-06-01 to 2026-10-21, and that API version refuses `temperature`, which the Math Standards Alignment contract pins: on anthropic 2.3.0 its live tests fail with "temperature: Extra inputs are not permitted". The mocked wire tests can't see this, since the API is what refuses it. The 0.77.0 floor passes the Anthropic integration tests live. Refs: DSCR-2625 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adnanrhussain
approved these changes
Nov 2, 2026
adnanrhussain
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Some minor feedback
…thon The `Lowest vendor SDKs` job now reads its Python from `requires-python` instead of fixing 3.13, so the oldest SDKs run on the oldest interpreter a caller may have. The dependency comment drops its list of verified versions, which went stale with every Dependabot bump, and says that only the vendor SDK lower bounds are tested at their floor. Refs: DSCR-2625 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Why
The vendor SDK floors (
openai>=2.47.0,anthropic>=1.0.0) were set where openai and anthropic moved to the httpx2 transport. They weren't the oldest versions our adapters work with. So a caller pinned to an older release couldn't install the package at all. A partner pinned to openai 1.109.1 hit exactly this. This is step 1 of the three-PR plan on DSCR-2625, and it ships in 1.x with no breaking change.Ticket: DSCR-2625.
Changes
Three commits.
test(python-sdk): drive each adapter through its real vendor clienttests/unit/providers/test_vendor_sdk_wire.pybuilds each adapter on the real vendor async client, with only the HTTP transport mocked. There's no network and the key is fake.generate_textand attachments.retry-after), timeout and connection failures from the real client are classified correctly.fix(python-sdk): accept older openai and anthropic releases, and anthropic 2.x (the 2.x part is undone below)>=2.47.0,<4>=1.108.1,<4omit>=1.0.0,<2>=0.77.0,<2messages.createtakesoutput_config>=1.39.0,<3Client.close/aclosedevnow declareshttpx2. The tests build vendor errors on httpx 2 types, and at the new floors nothing else installs it.pyproject.toml, installs exactly those versions on the oldest Pythonrequires-pythonallows, and runs the tests, so the floors stay true. It runs tests only. At these versions mypy flags test code that passes httpx 2 types to vendor errors typed for httpx 1. Nothing insrc/is affected.For reviewers
Going lower needs code changes, so they're not in this PR:
NOT_GIVENwhenomitis missing.output_configthroughextra_body. Not verified against the live API.Worth doing only if a partner needs it. The openai fallback is the cheap one.
fix(python-sdk): accept openai from 1.108.1 follows review: the first search sampled 1.99.9 and 2.0.0 only. The real floor is 1.108.1, which covers the partner's 1.109.1.fix(python-sdk): keep anthropic below 2 follows review. The live Anthropic tests fail on anthropic 2.3.0: 2.0 moved the defaultanthropic-versionheader from 2023-06-01 to 2026-10-21, and that API version refuses thetemperaturethe Math Standards Alignment contract pins. The mocked wire tests can't see it, because the API refuses it, not the SDK. Every 1.x release still sends 2023-06-01. Admitting 2.x is a separate change: deciding what the adapter sends under the new API version.Conflicts with the extras PR feat(python-sdk): add per-provider extras and report a missing vendor SDK #410 (stacked on feat(python-sdk): add llm_provider to inject a caller-supplied LLM provider #405): it repeats these pins in its new extras. Whichever merges second updates both places.
Testing
make verifypasses on the newest allowed SDKs: 1724 passed, 107 skipped.temperature: Extra inputs are not permitted, which is why the cap stays<2. OpenAI's were run on 1.108.1 in review.omitimport.output_configis rejected.Client.close.scripts/check.pypasses.🤖 Generated with Claude Code