From 953b93d1a87293bbf3663f2ca7f83726b56cfbe2 Mon Sep 17 00:00:00 2001 From: alchemicjon Date: Mon, 19 Oct 2026 12:45:28 -0400 Subject: [PATCH] fix: ensure reasoning field in provider_specific_fields is redacted --- litellm/litellm_core_utils/redact_messages.py | 1 + tests/unit/litellm_core_utils/test_redact_messages.py | 1 + 2 files changed, 2 insertions(+) diff --git a/litellm/litellm_core_utils/redact_messages.py b/litellm/litellm_core_utils/redact_messages.py index c2cca5739cf..55741790954 100644 --- a/litellm/litellm_core_utils/redact_messages.py +++ b/litellm/litellm_core_utils/redact_messages.py @@ -147,6 +147,7 @@ def _redacted_provider_specific_fields(fields: Mapping[str, object]) -> Mapping[ return { **fields, **({"reasoning_content": REDACTED_BY_LITELLM} if fields.get("reasoning_content") is not None else {}), + **({"reasoning": REDACTED_BY_LITELLM} if fields.get("reasoning") is not None else {}), **{key: None for key in ("thinking_blocks", "reasoningContentBlocks", "citations") if key in fields}, } diff --git a/tests/unit/litellm_core_utils/test_redact_messages.py b/tests/unit/litellm_core_utils/test_redact_messages.py index d14f236f765..f279cf82cef 100644 --- a/tests/unit/litellm_core_utils/test_redact_messages.py +++ b/tests/unit/litellm_core_utils/test_redact_messages.py @@ -51,6 +51,7 @@ SIGNATURE: Final = "opaque-thought-signature" def _provider_fields() -> dict[str, object]: return { "reasoning_content": SECRET, + "reasoning": SECRET, "thinking_blocks": [{"type": "thinking", "thinking": SECRET}], "reasoningContentBlocks": [{"reasoningText": {"text": SECRET}}], "citations": [{"cited_text": SECRET}],