From 2fc4f448b32f76beff0b2a59227efe1e78eae57c Mon Sep 17 00:00:00 2001 From: Sangsiva <101570025+Sangsiva@users.noreply.github.com> Date: Mon, 21 Sep 2026 16:17:22 +0800 Subject: [PATCH] fix(anthropic): drop Final on loop-locals in identity strip Loop-bound Final declarations trip basedpyright's reportGeneralTypeIssues. --- .../experimental_pass_through/messages/transformation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py b/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py index c32a5412839..1f8b78fa08e 100644 --- a/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py +++ b/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py @@ -158,14 +158,14 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig): if content_type != "text": filtered_list.append(content_block) continue - stripped_text: Final[str | None] = strip_claude_code_identity(text) + stripped_text = strip_claude_code_identity(text) if stripped_text is None: continue # Only copy the block when the text changed. if stripped_text == text: filtered_list.append(content_block) else: - rewritten: Final = {**content_block, "text": stripped_text} # mutable-ok: API message payload + rewritten = {**content_block, "text": stripped_text} # mutable-ok: API message payload filtered_list.append(rewritten) else: # Keep non-dict items as-is