From 8745f355a485cf9e3db12d5df20161ec62aa24cf Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 20 Jul 2026 19:30:26 -0700 Subject: [PATCH] fix(bedrock_mantle): log additional_tools hoist at debug level --- .../bedrock_mantle/responses/transformation.py | 6 ++++++ ...est_bedrock_mantle_responses_transformation.py | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/litellm/llms/bedrock_mantle/responses/transformation.py b/litellm/llms/bedrock_mantle/responses/transformation.py index 9ee19f7f4f2..eb818b26f1f 100644 --- a/litellm/llms/bedrock_mantle/responses/transformation.py +++ b/litellm/llms/bedrock_mantle/responses/transformation.py @@ -177,6 +177,12 @@ class BedrockMantleResponsesAPIConfig(BedrockMantleAuthMixin, OpenAIResponsesAPI return input, [] remaining_input = [item for item in input if not cls._is_codex_additional_tools_item(item)] hoisted_tools = [tool for item in additional_tools_items for tool in cls._tools_of_additional_tools_item(item)] + verbose_logger.debug( + "Bedrock Mantle Responses API: hoisting %d tool(s) out of %d 'additional_tools' input item(s) " + "into the top-level tools param (Mantle rejects that input item type).", + len(hoisted_tools), + len(additional_tools_items), + ) return remaining_input, cls._filter_unsupported_tools(hoisted_tools) def map_openai_params( diff --git a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py index bf36454ad72..a40e2e33809 100644 --- a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py +++ b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py @@ -495,6 +495,21 @@ class TestBedrockMantleCodexAdditionalTools: assert body["input"] == [self._USER_MESSAGE] assert "tools" not in body + def test_hoist_is_logged_at_debug_level(self): + from unittest.mock import patch + + with patch( + "litellm.llms.bedrock_mantle.responses.transformation.verbose_logger.debug" + ) as mock_debug: + self._transform( + input=[ + {"type": "additional_tools", "role": "developer", "tools": self._CODEX_TOOLS}, + self._USER_MESSAGE, + ] + ) + assert mock_debug.call_count == 1 + assert "additional_tools" in str(mock_debug.call_args) + class TestBedrockMantleResponsesRegistry: def test_registry_returns_config_for_gpt_5_5(self, local_cost_map):