Skip to content

fix(openai): support SDK 3 HTTPX2 clients - #2583

Closed
trumandaniels wants to merge 1 commit into
567-labs:mainfrom
trumandaniels:fix/openai-v3-httpx2
Closed

trumandaniels wants to merge 1 commit into
567-labs:mainfrom
trumandaniels:fix/openai-v3-httpx2

Conversation

@trumandaniels

@trumandaniels trumandaniels commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #2553 by supporting OpenAI SDK 3 and its HTTPX2 transport in automatic provider construction.

PR #2558 established that pre-built OpenAI 3 clients can be wrapped. This patch covers the remaining from_provider("openai/...") path, which imported legacy httpx even though OpenAI 3 no longer installs it.

Changes

  • remove the runtime import and type coupling to legacy httpx
  • pass caller-provided HTTP clients through to the OpenAI SDK
  • support openai>=2.0.0,<4.0.0 for core and Perplexity dependencies
  • test both synchronous and asynchronous construction
  • update the changelog and lockfile metadata

Testing

  • OpenAI 2 locked environment: 11 passed
  • OpenAI 3.3 isolated environment: 38 passed
  • minimal OpenAI 3 provider construction passed without legacy httpx
  • Ruff format and lint passed
  • frozen lockfile sync passed
  • lockfile validation and git diff --check passed

Upstream CI is waiting for maintainer approval because this is a first-time contributor pull request.

This PR was written by Cursor

Remove the runtime dependency on legacy HTTPX during automatic client
construction. Permit OpenAI 3 while preserving OpenAI 2 support on
Python 3.9, and cover both synchronous and asynchronous paths.

Refs: 567-labs#2553
@jxnl

jxnl commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Superseded by the consolidated implementation in #2597: #2597 . The release branch includes this fix or its deduplicated equivalent, with additional regression coverage. Closing the overlapping source PR to keep review in one place. This does not mean the release is merged or shipped: #2597 remains draft pending exact-head CI, independent review, and unresolved security sign-off.

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.

Adding support to openai v3.x.x

2 participants