diff --git a/tests/integration/providers/test_responses_bridge_message_cache_control_wire.py b/tests/integration/providers/test_responses_bridge_message_cache_control_wire.py index 4b25275285e..1d3551fe549 100644 --- a/tests/integration/providers/test_responses_bridge_message_cache_control_wire.py +++ b/tests/integration/providers/test_responses_bridge_message_cache_control_wire.py @@ -962,10 +962,10 @@ def _shaped_requests(model: str, shape: str) -> tuple[dict[str, JsonValue], dict pytest.param(f"openrouter/anthropic/{ANTHROPIC_MODEL}", "system", True, id="openrouter-claude"), pytest.param("openrouter/google/gemini-3.8-flash", "system", True, id="openrouter-gemini"), pytest.param("snowflake/claude-4-sonnet", "tool", True, id="snowflake-claude-tool-output"), + pytest.param("snowflake/claude-4-sonnet", "system", True, id="snowflake-claude-string-system"), pytest.param("vertex-claude", "system", True, id="vertex-claude"), pytest.param("sap-claude", "system", True, id="sap-claude"), pytest.param("anthropic/my-gateway-model", "system", True, id="anthropic-non-claude-name"), - pytest.param("snowflake/claude-4-sonnet", "system", False, id="snowflake-claude-string-system"), pytest.param("openrouter/openai/gpt-5.4", "system", False, id="openrouter-gpt"), pytest.param("snowflake/llama3.1-70b", "system", False, id="snowflake-llama"), pytest.param("snowflake/llama-claude-distill", "system", False, id="snowflake-claude-inside-the-name"), diff --git a/tests/unit/llms/snowflake/chat/test_snowflake_chat_transformation.py b/tests/unit/llms/snowflake/chat/test_snowflake_chat_transformation.py index a51174c90c3..f907e92e4ab 100644 --- a/tests/unit/llms/snowflake/chat/test_snowflake_chat_transformation.py +++ b/tests/unit/llms/snowflake/chat/test_snowflake_chat_transformation.py @@ -359,6 +359,15 @@ class TestSnowflakeCortexClaudeFixes: ) assert body["system"] == [{"type": "text", "text": "You are helpful", "cache_control": {"type": "ephemeral"}}] + def test_string_system_prompt_keeps_its_message_cache_control_without_ttl(self): + body = self._transform( + [ + {"role": "system", "content": "You are helpful", "cache_control": {"type": "ephemeral", "ttl": "1h"}}, + {"role": "user", "content": "hi"}, + ] + ) + assert body["system"] == [{"type": "text", "text": "You are helpful", "cache_control": {"type": "ephemeral"}}] + def test_direct_system_param_is_normalized(self): body = self._transform( [{"role": "user", "content": "hi"}],