[Test] Proxy E2E: Opt In To Client Mock Response For Model Access Tests - #26941
Conversation
The proxy's ingress hardening (commit 842eea0) now strips client-supplied `mock_response` from the request body unless the calling key or team has the `allow_client_mock_response: true` admin-metadata flag set. The e2e model access tests rely on `mock_response` to short-circuit the LLM call, so without the flag they hit real backends — the bedrock wildcard route fakes out to a shared example endpoint that now 404s on unsupported paths, causing `test_model_access_patterns[key_models2-bedrock/anthropic.claude-3-True]` (and the bedrock/anthropic.* row that pytest -x never reaches) to fail. Set `allow_client_mock_response: true` on every key and team this test file provisions so `mock_response` is preserved end-to-end.
Greptile SummaryThis PR adapts Confidence Score: 5/5Safe to merge — test-only change that correctly opts in to the existing admin-metadata flag without weakening any assertions. The change is minimal and well-scoped: it propagates the No files require special attention.
|
| Filename | Overview |
|---|---|
| tests/otel_tests/test_e2e_model_access.py | Adds allow_client_mock_response: true metadata to all key/team creation calls so the proxy's ingress hardening doesn't strip mock_response from test requests; no logic changes to assertions or access-control checks. |
Reviews (1): Last reviewed commit: "[Test] Proxy E2E: Opt In To Client Mock ..." | Re-trigger Greptile
326bcd6
into
litellm_internal_staging
…cbb6cf [Test] Proxy E2E: Opt In To Client Mock Response For Model Access Tests
Summary
mock_response/mock_tool_callsto_UNTRUSTED_ROOT_CONTROL_FIELDSinlitellm/proxy/litellm_pre_call_utils.py— they are now stripped from client requests unless the calling key or team has admin-metadataallow_client_mock_response: true.tests/otel_tests/test_e2e_model_access.pyrelies onmock_response(passed inextra_body) to short-circuit completions. Without the flag the request actually runs; thebedrock/*route inotel_test_config.yamlpoints at a shared fake endpoint that 404s on unsupported bedrock paths, sotest_model_access_patterns[key_models2-bedrock/anthropic.claude-3-True]started failing in CI.allow_client_mock_response: trueon every key and team this test creates. No production code changes.Failing job: https://app.circleci.com/pipelines/github/BerriAI/litellm/75860/workflows/b6853c9c-8b58-4036-a6b3-43e1d3616c9c/jobs/1589284/tests#failed-test-0
Test plan
proxy_logging_guardrails_model_info_testspasses (it runstests/otel_testsagainst the proxy withotel_test_config.yaml)