diff --git a/litellm/litellm_core_utils/prompt_templates/common_utils.py b/litellm/litellm_core_utils/prompt_templates/common_utils.py index f48a42963cf..af6d4a9333e 100644 --- a/litellm/litellm_core_utils/prompt_templates/common_utils.py +++ b/litellm/litellm_core_utils/prompt_templates/common_utils.py @@ -3261,12 +3261,10 @@ def parse_tool_call_arguments( repaired: Final = _attempt_json_repair(arguments) if repaired is not None: verbose_logger.warning( - "Repaired truncated tool call arguments for tool '%s' (%s). Original (%d chars): %.200s%s", + "Repaired truncated tool call arguments for tool '%s' (%s). Original length: %d chars", tool_name or "", context or "unknown context", len(arguments), - arguments, - "..." if len(arguments) > 200 else "", ) return repaired diff --git a/tests/unit/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py b/tests/unit/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py index a17deedf7a9..44c9252d213 100644 --- a/tests/unit/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py +++ b/tests/unit/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py @@ -297,6 +297,20 @@ def test_parse_tool_call_arguments_rejects_concatenated_json() -> None: parse_tool_call_arguments('{"a":1}{"b":2}') +def test_parse_tool_call_arguments_repair_warning_omits_argument_content() -> None: + from unittest.mock import patch + + secret: Final = "patient-record-4471" + with patch("litellm.litellm_core_utils.prompt_templates.common_utils.verbose_logger") as logger: + result: Final = parse_tool_call_arguments('{"note": "' + secret + '"', tool_name="save_note", context="test") + + assert result == {"note": secret} + logger.warning.assert_called_once() + logged: Final = " ".join(str(arg) for arg in logger.warning.call_args.args) + assert "save_note" in logged + assert secret not in logged + + def _distinct_json_objects(count: int) -> str: return "".join(json.dumps({"n": index}, separators=(",", ":")) for index in range(count))