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 the streaming and non-streaming parsers, reproduce the mismatch with focused tests, then patch the shared behavior and run the relevant suite.
- Assistant
The mismatch is in end-of-stream recovery: non-streaming always falls back to the generic XML parser, while streaming only recovers if a model-specific parser happened to be configured. I’m tightening that recovery path so it operates on the complete raw stream independently of chunking, reasoning routing, and request tool-selection settings.
- Assistant
The focused unit tests can run in this Linux container, but the route-level streaming module cannot be collected because the installed MLX binding is missing
libmlx.so(Apple runtime dependency). I’m continuing with the parser/postprocessor tests and static checks that don’t require MLX. - Assistant
The recovery path now passes the full parser-focused suite: 277 tests. It handles arbitrarily split/multiple XML calls, reasoning-routed XML, absent tool parsers or disabled tool choice, and parser exceptions on malformed fragments.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.