Skip to content

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
mainfrom
masonc08/mps-anthropic-integration-tests
Open

Test the relayed AI Gateway proxy end-to-end and the non-relayed MPS tier pin#457
masonc08 wants to merge 1 commit into
mainfrom
masonc08/mps-anthropic-integration-tests

Conversation

@masonc08

@masonc08 masonc08 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

What & why

Hermetic integration coverage for launching Claude Code through an Anthropic Model Provider Service, both paths.

  • Relayed (new tests/test_gateway_proxy_integration.py): the existing proxy tests only drive handler-level fakes; nothing ran the actual start_proxy server 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.
  • Non-relayed (tests/test_agent_claude.py): one case for an api-key Anthropic MPS launched on a specific tier — pins ANTHROPIC_MODEL while keeping the routing header and apiKeyHelper.

Testing

Both paths are hermetic (no agent binary, no network, no workspace), so they run in CI's test job on every PR. Full hermetic suite green locally (2167 passed); ruff check + ruff format --check clean.

This pull request and its description were written by Isaac.

…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
masonc08 marked this pull request as ready for review September 2, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants