From b976871453aa021bc2c9ba8f9f3fc283464b6687 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 25 May 2026 13:10:18 +0000 Subject: [PATCH] fix: lazy debug logging in clear_tool_uses; remove unused context_management constants Co-authored-by: Yassin Kortam --- .../experimental_pass_through/context_management/constants.py | 2 -- .../context_management/editors/clear_tool_uses.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/context_management/constants.py b/litellm/llms/anthropic/experimental_pass_through/context_management/constants.py index c5775315856..4003591c0d4 100644 --- a/litellm/llms/anthropic/experimental_pass_through/context_management/constants.py +++ b/litellm/llms/anthropic/experimental_pass_through/context_management/constants.py @@ -1,8 +1,6 @@ """Constants for the in-gateway context-management polyfill.""" CLEAR_TOOL_USES_EDIT_TYPE = "clear_tool_uses_20250919" -CLEAR_THINKING_EDIT_TYPE = "clear_thinking_20251015" -COMPACT_EDIT_TYPE = "compact_20260112" DEFAULT_INPUT_TOKENS_TRIGGER = 100_000 DEFAULT_KEEP_TOOL_USES = 3 diff --git a/litellm/llms/anthropic/experimental_pass_through/context_management/editors/clear_tool_uses.py b/litellm/llms/anthropic/experimental_pass_through/context_management/editors/clear_tool_uses.py index c2193406b32..4e9bab0f4e2 100644 --- a/litellm/llms/anthropic/experimental_pass_through/context_management/editors/clear_tool_uses.py +++ b/litellm/llms/anthropic/experimental_pass_through/context_management/editors/clear_tool_uses.py @@ -177,7 +177,7 @@ def apply_clear_tool_uses_20250919( ids_to_clear.discard(last_completed_id) edited, cleared_count = _clear_tool_results(messages, ids_to_clear) - verbose_logger.debug(f"context_management polyfill: edited: {edited}") + verbose_logger.debug("context_management polyfill: edited: %s", edited) if cleared_count == 0: return messages, None