fix: include redacted_thinking in list-content thinking block detection

The _list_has_thinking guard only checked for type == "thinking" but
Anthropic can also return redacted_thinking blocks (safety-filtered).
These are also accumulated in thinking_blocks, so the same duplication
bug would occur with redacted thinking content.
This commit is contained in:
Chesars 2026-03-10 16:37:06 -03:00
parent 0680a97409
commit 3fe4829676

View file

@ -2626,7 +2626,7 @@ def anthropic_messages_pt( # noqa: PLR0915
_list_has_thinking = False
if _content_is_list:
for _item in assistant_content_block["content"]:
if isinstance(_item, dict) and _item.get("type") == "thinking":
if isinstance(_item, dict) and _item.get("type") in ("thinking", "redacted_thinking"):
_list_has_thinking = True
break