Skip to content

Add a first-class integration for classic httpx #82

Description

@bagowix

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions