fix: add reasoning_items to unsupported_delta_fields in streaming serializer

The fast-serialization path dropped delta.reasoning_items by classifying
chunks with empty content and reasoning_items as simple text. Adding the field
to unsupported_delta_fields causes such chunks to fall through to model_dump_json,
preserving the encrypted reasoning state for multi-turn tool loops.

Fixes #38907
This commit is contained in:
Vedant-2-6 2026-08-31 18:43:24 +05:30
parent 4ba8517134
commit aa6fd8971d

View file

@ -8268,6 +8268,7 @@ def _fast_serialize_simple_model_response_stream(
"thinking_blocks",
"provider_specific_fields",
"refusal",
"reasoning_items",
)
if any(getattr(delta, field, None) is not None for field in unsupported_delta_fields):
return None