Python: allow OpenAI SDK 3.x - #7967
Conversation
Support the SDK-selected HTTP transport and its stricter Azure authentication while retaining the OpenAI 2.25.0 floor. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the lockfile change limited to the widened agent-framework-openai requirement metadata. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Expands agent-framework-openai compatibility to OpenAI SDK 3.x and adapts transport, authentication, and prompt-cache handling.
Changes:
- Raises the OpenAI dependency ceiling to
<4. - Makes feature-usage hooks transport-neutral.
- Updates Azure credential precedence and prompt-cache compatibility logic.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
python/uv.lock |
Updates locked dependency metadata. |
python/packages/openai/pyproject.toml |
Allows OpenAI SDK 3.x. |
python/packages/openai/agent_framework_openai/_shared.py |
Updates response imports and Azure authentication selection. |
python/packages/openai/agent_framework_openai/_feature_usage.py |
Removes the direct httpx dependency. |
python/packages/openai/agent_framework_openai/_chat_client.py |
Adds version-neutral prompt-cache typing. |
python/packages/openai/agent_framework_openai/_chat_completion_client.py |
Adds version-neutral prompt-cache typing. |
python/packages/openai/tests/openai/test_openai_shared.py |
Builds requests through the selected transport. |
python/packages/openai/tests/openai/test_openai_chat_client.py |
Stabilizes prompt-cache capability testing. |
python/packages/openai/tests/openai/test_openai_chat_completion_client.py |
Stabilizes prompt-cache capability testing. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (2 commit(s)): 875a4e62b487, 2b006a4123a7
Model: gpt-5.6-sol
Overview
The PR widens OpenAI SDK support to 3.x while adapting feature-usage request handling to the SDK-selected transport, preserving Azure credential precedence, and avoiding imports of optional prompt-cache types. Origin restrictions, explicit unsupported-feature guards, authentication tests, and successful package tests at both dependency boundaries provide strong coverage. No publishable Critical, High, or Medium issue was established.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
MAF Automated Review — Iteration 2
Result: No findings
Scope: 1 net-new commit(s): 681decdd07db
Model: gpt-5.6-sol
Overview
This incremental update suppresses Azure API-key environment fallback when an explicit credential is supplied and adds lock-bypassing CI lanes for the supported OpenAI SDK floors. The outbound-request test verifies bearer-token authentication without an api-key header, while both dependency-bound lanes run the full non-integration package suite and Pyright. No publishable Critical, High, or Medium issue remains in the reviewed range.
Reviewed the supplied incremental change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1d05669a-b93d-4cee-9392-c2cbf2ba2b5f
Motivation & Context
The shipped Python integrations that directly depend on the OpenAI SDK currently cap it below 3. This prevents them from being installed with dependencies such as
azure-ai-projects2.5.0, which requires OpenAI 3.x.This change widens the supported OpenAI range while retaining the existing package floors and preserving behavior across the Responses, Chat Completions, Embeddings, Azure OpenAI, DevUI, and hosting-responses surfaces.
Description & Review Guide
<4inagent-framework-openai, DevUI, hosting-responses, and the Hyperlight CodeAct sample; make feature-usage request handling work with the SDK-selectedhttpxorhttpx2transport without directly depending on either; suppress Azure API-key environment fallback when an explicit credential supplies a token provider; keep prompt-cache capability typing compatible with OpenAI 2.25.0; and add lock-bypassing CI lanes for each shipped OpenAI consumer on OpenAI 3.0.0 while retaining the 2.25.0 integration floor lane._shared.py, broadened dependency declarations, and the dependency-bound CI lanes.Related Issue
N/A
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.