Skip to content

Add HTTPX2 transports - #411

Merged
adamtheturtle merged 1 commit into
mainfrom
agent/issue-385-httpx2
Sep 7, 2026
Merged

adamtheturtle merged 1 commit into
mainfrom
agent/issue-385-httpx2

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add HTTPX2Transport and AsyncHTTPX2Transport with native HTTPX2 configuration, clients, responses, and exception behavior
  • preserve HTTPX as the default and ensure CoderPad clients close either built-in transport family
  • exercise real synchronous and asynchronous HTTPX2 requests and document installation, selection, Screen usage, and migration

The tests use pytest-httpx2, whose dedicated httpcore2 mocker works with RESPX 0.23.1, so this change does not depend on lundberg/respx#317 or alias_httpx().

Validation

  • uv run --extra=dev pytest -q --cov-fail-under=100 --cov=src/ --cov=tests . (259 passed, 100% coverage)
  • all prek pre-commit, pre-push, and manual hooks

Fixes #385


Note

Low Risk
Additive transport layer and dependency with HTTPX remaining default; risk is mainly install surface and callers who mix httpx/httpx2 config objects at transport boundaries.

Overview
Adds opt-in HTTPX2 as an alternate HTTP stack alongside the existing HTTPX default: new HTTPX2Transport and AsyncHTTPX2Transport wrap pooled httpx2 clients, accept only httpx2 limits/proxy/timeout objects, and map responses into the same TransportResponse type.

CoderPad and AsyncCoderPad treat HTTPX2 transports like HTTPX for lifecycle (close / aclose on the main transport and optional screen_transport). Default construction and client APIs are unchanged.

Packaging and docs: runtime dependency httpx2>=2.12.0, dev pytest-httpx2, README/Sphinx sections on migration and separate Screen transport; Sphinx nitpick ignores for httpx2 config types.

Reviewed by Cursor Bugbot for commit be772b3. Bugbot is set up for automated code reviews on this repo. Configure here.

@adamtheturtle
adamtheturtle merged commit 001ae47 into main Sep 7, 2026
18 checks passed
@adamtheturtle
adamtheturtle deleted the agent/issue-385-httpx2 branch September 7, 2026 15:30

This branch was previously deployed

1 inactive deployment
development — be772b38 Deployed Sep 7, 2026 by adamtheturtle via pages #626
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.

Add HTTPX2 transport support

1 participant