fix(anthropic): guard against non-dict messages in strip_advisor_blocks_from_messages

This commit is contained in:
Ishaan Jaffer
2026-04-11 11:33:29 -07:00
parent 082f0afb83
commit 011e087939
+1 -1
View File
@@ -650,7 +650,7 @@ def strip_advisor_blocks_from_messages(messages: List[Any]) -> List[Any]:
control or on a follow-up turn.
"""
for message in messages:
if message.get("role") != "assistant":
if not isinstance(message, dict) or message.get("role") != "assistant":
continue
content = message.get("content")
if not isinstance(content, list):