Repository navigation
Intercept httpx2 in the Microsoft Bot's Anthropic endpoint test - #761
Merged
Merged
Conversation
anthropic 1.x sends through httpx2 rather than httpx. The test patched httpx.AsyncHTTPTransport, so with the newest SDK its request reached the real Anthropic API and failed with 401, breaking main's CI. It now patches httpx2.AsyncHTTPTransport, as the AG2 Bot's tests already do.
davidmckayv
requested review from
MikeRyanDev,
guidovizoso,
mxmzb and
tylerslaton
as code owners
October 8, 2026 20:19
4 tasks done
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.
main's CI is red on
aff4981e:agent-microsoft/tests/test_main.py::test_an_anthropic_key_uses_the_official_endpoint_when_compose_sets_a_blank_urlfailed with401 invalid x-api-keyfrom the real Anthropic API.The requirements are unpinned, and
anthropic1.12.1 now depends onhttpx2and sends throughhttpx2.AsyncHTTPTransport. The test patchedhttpx.AsyncHTTPTransport, so the request escaped the test harness. It now patcheshttpx2, matchingagent-ag2's tests. Test-only.Verified on fresh installs of each Bot's requirements:
agent-microsoft10 pass (the failing case reproduced before the change),agent-pydantic-ai13 pass.