diff --git a/litellm/proxy/spend_tracking/spend_tracking_utils.py b/litellm/proxy/spend_tracking/spend_tracking_utils.py index 6a0736ea9dc..3fd20bb7e81 100644 --- a/litellm/proxy/spend_tracking/spend_tracking_utils.py +++ b/litellm/proxy/spend_tracking/spend_tracking_utils.py @@ -1182,10 +1182,6 @@ def _sanitize_error_information_for_spend_logs( ``'input'`` / ``'messages'`` / ``'prompt'`` values *and* Pydantic v2 ``input_value=...`` assignments inside both ``error_message`` and ``traceback`` so prompts cannot leak through either field. - - An unknown-model rejection (``ProxyModelNotFoundError``) persists its - ``spend_log_error_message``, which names the route and the rejection - without the raw client ``model`` string, matching the ``unknown-model`` - placeholder in the row's ``model`` column. Scoped to the spend-log path — OTEL/Datadog/etc. callbacks still receive the untruncated error per ``LITELLM_TRUNCATION_DB_SAFEGUARD_NOTE``. diff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py b/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py index 056bbc87cd3..e9bbaf0c96e 100644 --- a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py +++ b/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py @@ -2771,7 +2771,9 @@ def test_sanitize_error_information_persists_no_raw_model_for_an_unknown_model_r ): error_information: Final = StandardLoggingPayloadSetup.get_error_information(original_exception=original_exception) - sanitized: Final = _sanitize_error_information_for_spend_logs(error_information, original_exception=original_exception) + sanitized: Final = _sanitize_error_information_for_spend_logs( + error_information, original_exception=original_exception + ) assert sanitized is not None assert sanitized["error_message"] == expected_error_message