Skip to content

Intercept httpx2 in the Microsoft Bot's Anthropic endpoint test - #761

Merged
davidmckayv merged 1 commit into
mainfrom
david/fix-agent-microsoft-httpx2
Oct 8, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
david/fix-agent-microsoft-httpx2

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

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_url failed with 401 invalid x-api-key from the real Anthropic API.

The requirements are unpinned, and anthropic 1.12.1 now depends on httpx2 and sends through httpx2.AsyncHTTPTransport. The test patched httpx.AsyncHTTPTransport, so the request escaped the test harness. It now patches httpx2, matching agent-ag2's tests. Test-only.

Verified on fresh installs of each Bot's requirements: agent-microsoft 10 pass (the failing case reproduced before the change), agent-pydantic-ai 13 pass.

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 davidmckayv added the full-ci Run the slow image builds on this PR label Oct 8, 2026
@davidmckayv
davidmckayv merged commit 99a329d into main Oct 8, 2026
19 checks passed
@davidmckayv
davidmckayv deleted the david/fix-agent-microsoft-httpx2 branch October 8, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run the slow image builds on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant