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.
This commit is contained in:
Li-john1021 2026-10-15 14:29:50 +08:00
parent ba77ca902b
commit 56ff4548e2

View file

@ -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