test(e2e): bypass the proxy response cache in the mid-conversation system and fallback tests - #37915
Merged
yuneng-berri merged 1 commit intoAug 22, 2026
Conversation
…stem and fallback tests
The mid-conversation system tests prime the prompt cache by re-sending an
identical /v1/messages body until its usage shows the full prefix read back
three times in a row. The e2e stack runs with the litellm response cache on,
so every resend after the first is served from redis with the first call's
usage and the streak can never form; the three unflagged-model tests have
failed on every litellm-e2e build since the consecutive-read check landed.
Send cache: {"no-cache": true} on RichMessagesRequest, as test_cache_control
already does, so each resend reaches the provider.
The two fallback tests sent the same "say hi" / max_tokens=16 body to the
gpt-5.5 fallback, so one empty (finish_reason=length) completion served the
second test from the response cache and failed both. Give each test a unique
prompt and leave gpt-5.5 enough tokens to emit text.
Contributor
Greptile SummaryThis test-only PR prevents proxy response-cache entries from interfering with provider prompt-cache and reliability fallback E2E tests.
Confidence Score: 5/5The PR appears safe to merge, with no actionable regressions identified in the changed E2E test paths. The cache bypass targets the proxy response cache rather than the provider prompt cache under test, while unique prompts and the larger output allowance remove the documented cross-test collision and empty-completion conditions without invalidating existing callers.
|
| Filename | Overview |
|---|---|
| tests/e2e/llm_translation/endpoints_client.py | Adds the established no-cache request control so repeated prompt-cache probes reach the provider instead of reusing a proxy response. |
| tests/e2e/router/reliability_support.py | Raises the completion limit for reliability requests; existing callers do not rely on the previous token count. |
| tests/e2e/router/test_reliability_fallbacks_e2e.py | Makes each fallback prompt unique without changing the fallback assertions or routing behavior. |
Reviews (1): Last reviewed commit: "test(e2e): bypass the proxy response cac..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
yuneng-berri
enabled auto-merge (squash)
August 22, 2026 05:02
tin-berri
approved these changes
Aug 22, 2026
4 tasks
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.
TLDR
Problem this solves:
litellm-e2ehas been red on every build since 2026-08-20: the threetest_unflagged_model_converts_system_reminder_and_succeedstests (Azure Foundry, Vertex, Bedrock Invoke) fail deterministically in_prime_prompt_cachewithprompt cache never became readable in full within 60.0sTestReliabilityFallbackstests to a single empty gpt-5.5 completionHow it solves it:
/v1/messagesbody until the usage shows the full prefix read back three times in a row. The e2e stack runs with the litellm response cache on, so every resend after the first is served from redis with the first call's usage (cache_read_input_tokensnever grows) and the streak can never form.RichMessagesRequestnow sendscache: {"no-cache": true}, the same bypasstest_cache_control.pyalready uses; the key is honored by the@clientcache check and filtered out before the provider request"say hi"/max_tokens=16body to thegpt-5.5fallback, so onefinish_reason=lengthcompletion with empty content served the second test from the response cache and failed both. Each test now uses a unique prompt, andchat_overrideleaves gpt-5.5 64 tokens to emit textTest-only change; no product code touched.
Relevant issues
Follows up #36968, which added the consecutive-read priming check. Failing builds: litellm-e2e 43–50 (e.g. https://buildkite.com/berriai-1/litellm-e2e/builds/50).
Pre-Submission checklist