Phase 2: HTTPXWrapper initial implementation#22704
Draft
mwdd146980 wants to merge 1 commit intographite-base/22704from
Draft
Phase 2: HTTPXWrapper initial implementation#22704mwdd146980 wants to merge 1 commit intographite-base/22704from
mwdd146980 wants to merge 1 commit intographite-base/22704from
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Feb 20, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files🚀 New features to boost your workflow:
|
Contributor
Author
Code reviewFound 2 issues:
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
d4075a6 to
df634c5
Compare
97854d1 to
8fc9e4f
Compare
df634c5 to
c95925b
Compare
This was referenced Feb 23, 2026
c95925b to
cdd0d69
Compare
05fc099 to
54aa5eb
Compare
cdd0d69 to
654cd59
Compare
This comment has been minimized.
This comment has been minimized.
654cd59 to
6cc127d
Compare
httpx was already present transitively via httpx-gssapi/ntlm/kerberos. Declaring it explicitly pins the version and signals intent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6cc127d to
3cf3aa0
Compare
This was referenced Mar 13, 2026
3 tasks
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.

What does this PR do?
Implements Phase 2 of the requests → httpx migration (Phase 1: PR #22676).
New:
http_httpx.pyHTTPXWrapper— wrapshttpx.Client, satisfiesHTTPClientProtocol, translates httpx exceptions to theHTTPErrorhierarchyHTTPXResponseAdapter— bridgeshttpx.ResponsetoHTTPResponseProtocol: addsiter_content(httpx usesiter_bytes/iter_text), adaptsiter_linessignature, and adds__enter__/__exit__(httpx responses aren't context managers)httpx.TimeoutException→HTTPTimeoutError,httpx.ConnectError→HTTPConnectionError, etc.New:
use_httpxfeature flag inAgentCheck.httpuse_httpx: truein instance config to opt a check into the httpx backendself.httpget the flag for free; no call-site changes requiredRequestsWrapperProof of concept: nginx
test_get_enabled_endpointsandtest_only_query_enabled_endpointsnow run with both[requests]and[httpx]backends — all passrequests.Sessiondirectly (test_config,test_no_version) are left on the requests backend; they document the config parity gap (auth/SSL forwarding tohttpx.Client) deferred to Phase 3Backend equivalence tests
test_http_backend_equivalence.py:RequestsWrapperandHTTPXWrapperproduce identical responses forstatus_code,content,iter_lines,iter_content, and context manager usageKnown limitations (Phase 3 work)
HTTPXWrappercurrently wraps a plainhttpx.Client(). Instance config options (auth, TLS, proxy, timeouts) are not yet forwarded to the httpx client. Integrations that rely ontest_config-style assertions againstrequests.Sessionkwargs will need per-integration follow-up once config parity is implemented.Motivation
RFC: Migrate the HTTP layer from requests to httpx
Phase 1 established the protocol boundary. Phase 2 provides the httpx implementation and the opt-in mechanism.
Review checklist (to be filled by reviewers)
qa/skip-qalabel if the PR doesn't need to be tested during QA.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged