From 63de65dc3a6830ffe80cc0ddd6192326cd1a3d39 Mon Sep 17 00:00:00 2001 From: shivam Date: Sat, 19 Sep 2026 20:49:13 +0000 Subject: [PATCH] test(headroom): assert the unknown-model fallback instead of a vendor caching fact Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../proxy/guardrails/guardrail_hooks/test_headroom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_headroom.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_headroom.py index 0523edb9883..5b513db8513 100644 --- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_headroom.py +++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_headroom.py @@ -3154,10 +3154,10 @@ async def test_implicit_cache_protection_skipped_when_request_carries_cache_cont @pytest.mark.asyncio -async def test_model_without_prompt_caching_keeps_compressing_history(): +async def test_model_unknown_to_the_cost_map_keeps_compressing_history(): guardrail = _make_guardrail( implicit_cache_frozen_messages=None, - llm_router_getter=lambda: _StubRouter("openai/o1-mini"), + llm_router_getter=lambda: _StubRouter("openai/model-not-in-cost-map"), ) messages = _agentic_request(2) @@ -3170,7 +3170,7 @@ async def test_model_without_prompt_caching_keeps_compressing_history(): with patch.object(guardrail.async_handler, "post", new_callable=AsyncMock, side_effect=_record): result = await guardrail.apply_guardrail( inputs=GenericGuardrailAPIInputs(texts=["x"], structured_messages=json.loads(json.dumps(messages))), - request_data={"model": "o1", "messages": json.loads(json.dumps(messages))}, + request_data={"model": "unknown", "messages": json.loads(json.dumps(messages))}, input_type="request", )