Streaming drops XML tool-call output that non-streaming parses correctly Streaming must…
- User
Streaming drops XML tool-call output that non-streaming parses correctly
Streaming must emit the same recovered XML tool calls as non-streaming, including calls split across chunks and multiple calls, and finish with
tool_calls. Reasoning mode and request tool selection must not alter recovery. Plain text or malformed markup must not create calls or abort the stream.Interface
No new interfaces are introduced.
- Assistant
I'll trace how streaming and non-streaming parse XML tool calls and compare their recovery paths.
- Assistant
Implementing fixes: suppressed tool-markup chunks skip the finish event, partial
tool_accumulated_textblocks finalize recovery, and split<tool_call>markers miss the reasoning redirect. - Assistant
Fixed streaming XML tool-call recovery in
StreamingPostProcessor. Streaming was dropping tool calls that non-streamingextract_tool_callshandled correctly.Root causes
-
Suppressed final chunks — When the last delta was still inside tool markup (
extract_tool_calls_streamingreturnsNone), the processor returned[]before checkingtool_calls_detected, so nofinish_reason="tool_calls"was emitted. -
Wrong recovery buffer —
finalize()used . A partial (e.g. ) blocked recovery from the complete .
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.