From 2142fadfd9ecf12248d6f6c75696c2cf7150a0f1 Mon Sep 17 00:00:00 2001 From: ly-wang19 Date: Tue, 23 Jun 2026 19:20:06 +0800 Subject: [PATCH] test(oci): expect finish_reason="tool_calls" for a generic tool-call response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pre-existing test_transform_response_with_tool_calls asserted finish_reason=="stop" for a GENERIC response carrying tool calls — the old behavior this PR fixes. handle_generic_response now normalizes it to "tool_calls" (OpenAI semantics, consistent with the Cohere path's test_cohere_response_finish_reason_tool_call), so update the assertion. This is the failure the "All Other Providers" CI job surfaced. --- .../llms/oci/chat/test_oci_chat_transformation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/llms/oci/chat/test_oci_chat_transformation.py b/tests/test_litellm/llms/oci/chat/test_oci_chat_transformation.py index 53c9e4b207c..aaf0edc3590 100644 --- a/tests/test_litellm/llms/oci/chat/test_oci_chat_transformation.py +++ b/tests/test_litellm/llms/oci/chat/test_oci_chat_transformation.py @@ -700,7 +700,10 @@ class TestOCIChatConfig: choice = result.choices[0] assert isinstance(choice, litellm.Choices) - assert choice.finish_reason == "stop" + # The response carries tool calls, so finish_reason is normalized to + # "tool_calls" (OpenAI semantics) regardless of OCI's raw "stop" — matching + # the Cohere path (test_cohere_response_finish_reason_tool_call). + assert choice.finish_reason == "tool_calls" # Message and tool_calls assertions message = choice.message