Motivation
The shipped transport integration targets httpx2, while a large part of the Python ecosystem—including the OpenAI and Anthropic SDKs—still uses classic httpx. The current LLM guide therefore has to use decorator-level protection and explicitly says the transport cannot be reused.
A native httpx transport would materially reduce adoption friction and make per-host protection transparent for existing clients.
Proposed scope
Add an optional interlock-cb[httpx] extra with sync and async transport wrappers built only on httpx's public transport API, mirroring the proven httpx2 behavior where appropriate.
Acceptance criteria
- Provide sync and async transport classes under
interlock.integrations.httpx.
- Keep one breaker per request host and reject host-less URLs eagerly.
- Reuse the canonical status classifier defaults (
429, 500, 502, 503, 504) with configurable statuses.
- Delegate
close() / aclose() and preserve streaming response semantics.
- Add unit and loopback E2E tests for success, classified failures, transport exceptions, per-host isolation, open rejection before I/O, and cleanup.
- Test the minimum supported httpx version and latest version in CI.
- Add installation, API, integration, and LLM-SDK documentation.
- Keep the core dependency-free and avoid private httpx APIs.
Non-goals
- Replacing the existing
httpx2 integration.
- Adding retry behavior inside the transport.
Motivation
The shipped transport integration targets
httpx2, while a large part of the Python ecosystem—including the OpenAI and Anthropic SDKs—still uses classichttpx. The current LLM guide therefore has to use decorator-level protection and explicitly says the transport cannot be reused.A native
httpxtransport would materially reduce adoption friction and make per-host protection transparent for existing clients.Proposed scope
Add an optional
interlock-cb[httpx]extra with sync and async transport wrappers built only on httpx's public transport API, mirroring the provenhttpx2behavior where appropriate.Acceptance criteria
interlock.integrations.httpx.429, 500, 502, 503, 504) with configurable statuses.close()/aclose()and preserve streaming response semantics.Non-goals
httpx2integration.