Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(bedrock_mantle): log additional_tools hoist at debug level

mateo-berri8745f355a485
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):