From ca3ade45e0014f26dda19de50cb041d2e6a28c63 Mon Sep 17 00:00:00 2001 From: Darsh Joshi Date: Sat, 3 Oct 2026 11:52:03 -0400 Subject: [PATCH] test(deepseek): assert tool result images move into a user message The tool result image test only checked that the image appeared somewhere in the output, so it still passed if the image stayed inside the tool message, which DeepSeek ignores. Assert the tool message keeps its tool_call_id without the image and the following user message carries it --- .../deepseek/chat/test_deepseek_chat_transformation.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/unit/llms/deepseek/chat/test_deepseek_chat_transformation.py b/tests/unit/llms/deepseek/chat/test_deepseek_chat_transformation.py index 9c584ffa605..0cfd7e4ae6a 100644 --- a/tests/unit/llms/deepseek/chat/test_deepseek_chat_transformation.py +++ b/tests/unit/llms/deepseek/chat/test_deepseek_chat_transformation.py @@ -175,9 +175,12 @@ class TestDeepSeekVisionMultimodalContent: result = self.config._transform_messages([tool_message], model=self.VISION_MODEL) - assert result[0]["role"] == "tool" - assert result[0]["tool_call_id"] == "call_1" - assert any(isinstance(message["content"], list) and image_block in message["content"] for message in result) + tool_result, image_carrier = result + assert tool_result["role"] == "tool" + assert tool_result["tool_call_id"] == "call_1" + assert image_block not in tool_result["content"] + assert image_carrier["role"] == "user" + assert image_block in image_carrier["content"] def test_audio_block_collapsed_even_on_vision_model(self): messages = [