Test the relayed AI Gateway proxy end-to-end and the non-relayed MPS tier pin - #457
Open
masonc08 wants to merge 1 commit into
Open
Test the relayed AI Gateway proxy end-to-end and the non-relayed MPS tier pin#457masonc08 wants to merge 1 commit into
masonc08 wants to merge 1 commit into
Conversation
…tier pin Add tests/test_gateway_proxy_integration.py: stand up the real refresh proxy via start_proxy over sockets against a fake upstream and assert the relayed data-plane end to end -- swap-token injection, Anthropic OAuth / MPS-header / body passthrough, SSE streaming relay, and the 401 force-refresh-and-retry. The existing test_gateway_proxy.py only drives handler-level fakes, so the running server + real httpx client path was untested. Also add one non-relayed case in test_agent_claude.py: an api-key Anthropic MPS launched on a specific tier pins ANTHROPIC_MODEL (route_root_model) while keeping the routing header and apiKeyHelper. Both paths are hermetic (no agent binary, no network, no workspace), so they run in CI's test job on every PR. Co-authored-by: Isaac <no-reply@databricks.com>
masonc08
marked this pull request as ready for review
September 2, 2026 17:46
lilly-luo
approved these changes
Sep 2, 2026
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 & why
Hermetic integration coverage for launching Claude Code through an Anthropic Model Provider Service, both paths.
tests/test_gateway_proxy_integration.py): the existing proxy tests only drive handler-level fakes; nothing ran the actualstart_proxyserver over sockets. These stand up the real proxy against a fake gateway upstream and assert the relayed data-plane end to end — swap-token injection, Anthropic OAuth / MPS-header / body passthrough, SSE streaming relay, and the 401 force-refresh-and-retry.tests/test_agent_claude.py): one case for an api-key Anthropic MPS launched on a specific tier — pinsANTHROPIC_MODELwhile keeping the routing header and apiKeyHelper.Testing
Both paths are hermetic (no agent binary, no network, no workspace), so they run in CI's
testjob on every PR. Full hermetic suite green locally (2167 passed);ruff check+ruff format --checkclean.This pull request and its description were written by Isaac.