We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e46151 commit 6ea8038Copy full SHA for 6ea8038
1 file changed
src/agents/models/chatcmpl_converter.py
@@ -786,8 +786,11 @@ def ensure_assistant_message() -> ChatCompletionAssistantMessageParam:
786
# "\n"-joined signatures format so existing in-flight sessions
787
# with the old encoding are not broken.
788
try:
789
- pending_thinking_blocks = json.loads(encrypted_content)
790
- except (json.JSONDecodeError, TypeError):
+ decoded = json.loads(encrypted_content)
+ if not isinstance(decoded, list):
791
+ raise ValueError("expected a list of block dicts")
792
+ pending_thinking_blocks = decoded
793
+ except (json.JSONDecodeError, TypeError, ValueError):
794
signatures = encrypted_content.split("\n")
795
796
reconstructed_thinking_blocks = []
0 commit comments