Repository navigation
Conversation
BREAKING CHANGE: SDK HTTP response hooks and transport exceptions now use HTTPX2. Plugins must migrate overrides and review the documented proxy, trust, authentication, and timeout settings.
5 tasks done
6 tasks
4 of 10 tasks
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.
Move SDK model requests, file uploads/downloads, and serverless callbacks to native synchronous HTTPX2 interfaces for SDK 0.12.0.
Closes #414.
Release target: SDK 0.12.0, alongside gevent removal in #340.
SDK 0.11.0 publication is tracked in #413 and retains the existing HTTP clients and gevent runtime.
This PR remains a draft for the later release.
The SDK previously exposed Requests responses in model overrides and HTTPX objects in file/runtime calls.
These are now
httpx2.Request,httpx2.Response, and HTTPX2 exceptions; the old compatibility adapters and codecs are removed.This is a breaking change for plugins that override or catch those interfaces.
The README includes the API migration table, context-managed credential validation, and proxy/certificate/timeout configuration changes for the planned 0.12.0 release.
One transport connects HTTPX2 to httpcore2's connection pool and network backend.
It preserves signed request targets, multipart content/current file positions, redirect behavior and credential stripping, incremental SSE/audio delivery, and response/client ownership.
The shared backend supports SOCKS4/4a/5/5h authentication and explicit local/remote DNS semantics.
Targets and HTTPS proxies use the same configured certificate trust, including SSL_CERT_FILE together with SSL_CERT_DIR, with hostname verification enabled.
Trailing-dot hosts retain their HTTP/DNS name while TLS uses the normalized SNI name.
Request headers are validated before network I/O with safe errors; trailing SP/HTAB is normalized without accepting embedded control characters.
Regression tests verify that synthetic credentials do not appear in exception chains, logs, or the actual SDK error-writer output.
TLS upgrades acquire ownership of the SSL socket before the handshake, so cancellation closes the connection even when callers retain the exception traceback.
This applies to direct connections, proxy TLS, tunneled target TLS, and SOCKS.
Direct dependencies on Requests, urllib3, and old HTTPX are removed; old HTTPX/httpcore are absent from the resolved environment.
tiktokenstill requires Requests/urllib3 for its own uncached tokenizer downloads.HTTPX2/httpcore2 and socksio provide the SDK transport; gevent remains the concurrency model in this candidate; #340 tracks its removal for the same SDK 0.12.0 release.
HTTPX2 is the package name, and this change does not force the HTTP/2 wire protocol.
Intentional integration changes include native HTTPX2 exception categories, shared system/explicit CA trust, explicit NETRC configuration,
socks5h://for remote DNS, and HTTPX2's per-operation write timeout rather than the old cumulative upload behavior.The two scoped internal imports are HTTPX2's environment proxy resolver and httpcore2's synchronous stream implementation; dependency upgrades need to retain the transport regression coverage.
Validation recorded for the transport implementation before the final SDK 0.12.0 integration:
just check, coverage gates, type checking of both transport modules, andjust buildpassed.Live vendor endpoints and native Windows/macOS were not exercised.
The branch must be reconciled with the final SDK 0.11.0 baseline, and the combined HTTPX2/native-runtime candidate needs its own validation before SDK 0.12.0 publication.
Compatibility Check
Available Checks
just buildhas passed.