Skip to content

test(e2e): move Vertex Claude Code cells from Sonnet 4.5 to Sonnet 4.6 - #54246

Merged
mateo-berri merged 1 commit into
BerriAI:mainfrom
paveln83:litellm_e2e_vertex_sonnet_4_6
Nov 24, 2026
Merged

mateo-berri merged 1 commit into
BerriAI:mainfrom
paveln83:litellm_e2e_vertex_sonnet_4_6

Conversation

@paveln83

@paveln83 paveln83 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

Our Claude Code e2e tests on Vertex now use Sonnet 4.6 instead of Sonnet 4.5. Google does not offer Sonnet 4.5 to new projects anymore, so these tests would all fail once CI moves to our new GCP project

Details

TLDR

Problem this solves:

  • Vertex no longer offers Claude Sonnet 4.5 to new GCP projects
  • On the new project, 13 Claude Code Vertex tests fail with 404

How it solves it:

  • The Vertex Sonnet test alias now points at Sonnet 4.6
  • The 16 Vertex test files ask for the new alias
  • The dead Sonnet 4.5 entry is gone from the dev config

User Flow

Before: a developer runs Claude Code through the gateway on a new GCP project, and every Sonnet request fails

  1. They start the proxy with the Claude Code test config and VERTEXAI_PROJECT set to a new GCP project
  2. They run claude --model claude-sonnet-4-5-vertex with ANTHROPIC_BASE_URL set to the proxy and ask it to write and run a file
  3. Claude Code shows "There's an issue with the selected model (claude-sonnet-4-5-vertex)", because Vertex answers 404

After: the same setup works with the Sonnet 4.6 alias

  1. They start the proxy with the same config and project
  2. They run claude --model claude-sonnet-4-6-vertex and ask the same thing
  3. Claude Code writes hello.py, runs it, and reports hello

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Both proxies ran the same code with 2 workers each, on a new GCP project with Vertex location global. Only the config file and test files differ: Before uses the merge base 23ca45756a8, After uses a1cd3f290c5

python litellm/proxy/proxy_cli.py --config tests/e2e/claude_code/test_config.yaml --port <port> --num_workers 2
# env: VERTEXAI_PROJECT, VERTEXAI_CREDENTIALS, DATABASE_URL, LITELLM_MASTER_KEY
Case Before (23ca457) After (a1cd3f2)
Claude Code TUI, Sonnet model error wrote and ran file
/v1/messages curl, Sonnet 404 200
16 Vertex test files 13 failed, 3 skipped 13 passed, 3 skipped

Before (23ca457)

Claude Code TUI

  1. claude --model claude-sonnet-4-5-vertex with ANTHROPIC_BASE_URL=http://127.0.0.1:25079 and ANTHROPIC_AUTH_TOKEN=$LITELLM_MASTER_KEY
  2. Typed: Write a file hello.py that prints hello, then run it and tell me the output
  3. Claude Code shows a model error

pr54246-a1cd3f290c-tui-base.png

/v1/messages curl
$ curl -s -X POST http://127.0.0.1:25079/v1/messages -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'content-type: application/json' -d '{"model": "claude-sonnet-4-5-vertex", "max_tokens": 32, "messages": [{"role": "user", "content": "Reply with the word OK"}]}'
{"type":"error","error":{"type":"not_found_error","message":"litellm.NotFoundError: Vertex_aiException - {\n  \"error\": {\n    \"code\": 404,\n    \"message\": \"Publisher model `projects/<new-project>/locations/global/publishers/anthropic/models/claude-sonnet-4-5` was not found or your project does not have access to it. ..."}}
16 Vertex test files
$ python -m pytest tests/e2e/claude_code/*/test_vertex_ai.py -n 4 --dist=loadfile -q -rA
13 failed, 3 skipped in 92.20s

All 13 failures are the Sonnet 4.5 model, claude CLI failed: exit=1; api_status=404. Haiku and Opus passed. Full log in the gist

After (a1cd3f2)

Claude Code TUI

  1. claude --model claude-sonnet-4-6-vertex with ANTHROPIC_BASE_URL=http://127.0.0.1:21495 and ANTHROPIC_AUTH_TOKEN=$LITELLM_MASTER_KEY
  2. Typed the same prompt
  3. Claude Code wrote hello.py, ran it, and reported hello

pr54246-a1cd3f290c-tui-head.png

/v1/messages curl
$ curl -s -X POST http://127.0.0.1:21495/v1/messages -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'content-type: application/json' -d '{"model": "claude-sonnet-4-6-vertex", "max_tokens": 32, "messages": [{"role": "user", "content": "Reply with the word OK"}]}'
{"id":"msg_vrtx_011ChH6gRonwwxfEQ8Ax5yDh","type":"message","role":"assistant","model":"claude-sonnet-4-6-vertex","content":[{"type":"text","text":"OK"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":12,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":4,"speed":"standard"},"container":null,"stop_details":null}
16 Vertex test files
$ python -m pytest tests/e2e/claude_code/*/test_vertex_ai.py -n 4 --dist=loadfile -q -rA
13 passed, 3 skipped in 91.29s

Full log in the gist

Notes from the run:

  • count_tokens, long_context_1m, tool_search skip on both legs
  • Those skips are existing ones, this PR leaves them alone
/live-pr-risk exemption at a1cd3f2

The diff changes no product code. The removed vertex-sonnet-4-5 and claude-sonnet-4-5-vertex names have no other reference in this branch merged with main (0fbc973492b), and GitHub code search finds none in other BerriAI repos. litellm/proxy/dev_config.yaml is only read when someone boots a local proxy with it. tests/e2e/claude_code/test_config.yaml is read by the e2e fixture that registers the models and by the daily compat cron, which is the same path the live run above covers

A focused check at a1cd3f290c5 printed this

16 vertex cell files; probed vertex names: ['claude-haiku-4-5-vertex', 'claude-opus-4-7-vertex', 'claude-sonnet-4-6-vertex']
missing from test_config.yaml: none
sonnet-4-5 vertex names left in test_config.yaml: none
dev_config.yaml parses, 39 models, duplicates: none , vertex-sonnet-4-5 present: False

Type

✅ Test

Caveats (if any)

Low

  • The dev config drop goes further than CI needs
    • Sonnet 4.5 still answers 200 on the current CI Vertex project, so "dead" is only true for the new project
    • vertex-sonnet-4-6 is already in the same file, so a developer only switches names. No CI job or test reads dev_config.yaml
  • Three edited files are skip-marked, so their Sonnet 4.6 swap never runs
    • count_tokens, long_context_1m and tool_search skip on both legs
    • The Sonnet 4.6 deployment keeps the context-1m-2025-08-07 beta header from 4.5, and only the skipped 1M cell would test it
  • Only the Vertex column moves to Sonnet 4.6
    • The Anthropic, Azure, Bedrock Converse and Bedrock Invoke columns still run Sonnet 4.5
    • The public compat page and the cell docstrings already say Sonnet 4.6 for every provider. That gap was there before this PR, and this PR makes it smaller

QA runbook

Every test below needs the proxy booted on tests/e2e/claude_code/test_config.yaml with VERTEXAI_PROJECT and VERTEXAI_CREDENTIALS set, claude on PATH, and LITELLM_PROXY_URL and LITELLM_MASTER_KEY exported. Each test runs Haiku 4.5, Sonnet 4.6, and Opus through Claude Code and needs all three to pass

Checklist for each of the 16 tests
  • tests/e2e/claude_code/basic_messaging_non_streaming/test_vertex_ai.py::test_basic_messaging_non_streaming_vertex_ai - Claude Code gets a plain reply
    • Run claude --model claude-sonnet-4-6-vertex and ask for the word pong, expect pong
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/basic_messaging_streaming/test_vertex_ai.py::test_basic_messaging_streaming_vertex_ai - same, streamed
    • Ask it to count from 1 to 5 with streaming on, expect a non-empty reply
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/count_tokens/test_vertex_ai.py::test_count_tokens_vertex_ai - token counting, skipped today
    • Expect a skip naming Vertex token counting for Claude aliases
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/long_context_1m/test_vertex_ai.py::test_long_context_1m_vertex_ai - 1M context, skipped today
    • Expect a skip naming 1M long context on Vertex
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/passthrough/test_vertex_ai.py::test_passthrough_vertex_ai - Claude Code works over the Vertex passthrough route
    • Point Claude Code at $LITELLM_PROXY_URL/vertex_ai and ask for pong, expect a reply
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/pdf_input/test_vertex_ai.py::test_pdf_input_vertex_ai - Claude Code reads a PDF
    • Give it a one-page PDF whose only text is PONG, expect PONG in the reply
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/prompt_caching_1h/test_vertex_ai.py::test_prompt_caching_1h_vertex_ai - 1 hour cache writes and reads
    • Ask for pong with a 1 hour cache on the system prompt, expect cache tokens in usage
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/prompt_caching_5m/test_vertex_ai.py::test_prompt_caching_5m_vertex_ai - 5 minute cache writes and reads
    • Same with the default 5 minute cache, expect cache tokens in usage
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/structured_outputs/test_vertex_ai.py::test_structured_outputs_vertex_ai - JSON output matches the schema
    • Run with --json-schema and ask what 2 + 2 is, expect output matching the schema
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/thinking/test_vertex_ai.py::test_thinking_vertex_ai - extended thinking works
    • Ask a question with --effort high, expect a thinking block in the response
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/thinking_with_tool_use/test_vertex_ai.py::test_thinking_with_tool_use_vertex_ai - thinking plus a tool call
    • With --effort high, ask it to reason about and then run echo pong, expect thinking and a Bash call
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/tool_search/test_vertex_ai.py::test_tool_search_vertex_ai - tool search, skipped today
    • Expect a skip naming tool_search and the 1M context beta header
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/tool_use/test_vertex_ai.py::test_tool_use_vertex_ai - Claude Code runs a tool
    • Ask it to run echo pong with the Bash tool, expect a tool_use block
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/tool_use_streaming/test_vertex_ai.py::test_tool_use_streaming_vertex_ai - same, streamed
    • Same with streaming on, expect a tool_use block
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/vision/test_vertex_ai.py::test_vision_vertex_ai - Claude Code reads an image
    • Send an image with the prompt, expect a non-empty reply
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky
  • tests/e2e/claude_code/web_search/test_vertex_ai.py::test_web_search_vertex_ai - web search runs through the proxy
    • Ask for an Anthropic headline from this week, expect a WebSearch tool call
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
Bugbot summary

[!NOTE]
Low Risk
Test and local dev YAML only; no production proxy logic, auth, or data paths change.

Overview
Vertex Claude Code e2e coverage now targets Claude Sonnet 4.6 instead of Sonnet 4.5, because new GCP projects no longer get Sonnet 4.5 on Vertex (404).

The e2e proxy routing in tests/e2e/claude_code/test_config.yaml renames the Sonnet alias to claude-sonnet-4-6-vertex and points it at vertex_ai/claude-sonnet-4-6. All 16 Vertex test_vertex_ai.py cells use that alias in their model lists. Local dev proxy config drops the obsolete vertex-sonnet-4-5 entry from litellm/proxy/dev_config.yaml.

No product/runtime LiteLLM code changes—only test configs and e2e model selections. Other providers in the matrix still exercise Sonnet 4.5 where applicable.

Reviewed by Cursor Bugbot for commit a1cd3f2. Bugbot is set up for automated code reviews on this repo. Configure here.

  • a1cd3f2 passes /live-pr-risk (E2E exempt)

@veria-ai

veria-ai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@mateo-berri mateo-berri added the autoapprove This PR may be autoapproved by greptile. The author thinks that it does not need human review. label Nov 24, 2026
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Moves the Vertex Claude Code tests from Sonnet 4.5 to Sonnet 4.6.

  • Claude Code’s Vertex Sonnet tests now use Sonnet 4.6.
  • The developer config no longer offers the Vertex Sonnet 4.5 alias.

paveln83 explicitly notes that Vertex Sonnet results now cover 4.6 rather than 4.5, and that CI will move to the new GCP project after merging. The three existing skipped tests remain unchanged.

Review checks were read-only. Live tests were not rerun.

Reviews (1) · Last reviewed commit: "test(e2e): move Vertex Claude Code cells..." · Reviewed by Greptile

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a1cd3f2. Configure here.

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mateo-berri
mateo-berri merged commit 2b44002 into BerriAI:main Nov 24, 2026
57 checks passed
yuneng-berri added a commit that referenced this pull request Nov 28, 2026
…teg_e2e_tests

chore(release): backport #54092, #54111, #54112, #54202, #52923, #54246 and #54305 to rc/1.112.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoapprove This PR may be autoapproved by greptile. The author thinks that it does not need human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants