From 56ff4548e2d2cb63f2929f6c3ba7089d22901e81 Mon Sep 17 00:00:00 2001 From: Li-john1021 <215793081+Li-john1021@users.noreply.github.com> Date: Thu, 15 Oct 2026 14:29:50 +0800 Subject: [PATCH] fix(anthropic): drop list annotation in thought-signature id parse LIT001 ceiling was one over merge-base because Final[list[str]] on the split of tool_call.id. Use str.partition instead so the signature path adds no mutable collection annotation. --- .../llms/anthropic/pass_through/adapters/transformation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/llms/anthropic/pass_through/adapters/transformation.py b/litellm/llms/anthropic/pass_through/adapters/transformation.py index 9340f9741d9..86c0866330e 100644 --- a/litellm/llms/anthropic/pass_through/adapters/transformation.py +++ b/litellm/llms/anthropic/pass_through/adapters/transformation.py @@ -386,9 +386,9 @@ class LiteLLMAnthropicMessagesAdapter: raw_id: Final[object] = _optional_attr(tool_call, "id") if isinstance(raw_id, str) and THOUGHT_SIGNATURE_SEPARATOR in raw_id: - parts: Final[list[str]] = raw_id.split(THOUGHT_SIGNATURE_SEPARATOR, 1) - if len(parts) == 2 and parts[1]: - return parts[1] + _, _, embedded = raw_id.partition(THOUGHT_SIGNATURE_SEPARATOR) + if embedded: + return embedded return None