@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 7a51b3e415
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 5, 01:00 UTC

[Bugfix] Fix empty delta detection in Qwen3XMLToolParser streaming (#40090)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>

Chauncey committed Apr 17, 2026 at 21:34 UTC 7a51b3e415eeb2954e471e8b5a3898047276e492
2 files changed +7 -7
tests/tool_parsers/test_qwen3xml_tool_parser.py
-3
@@ -64,9 +64,6 @@ class TestQwen3xmlToolParser(ToolParserTests):
64 "test_empty_arguments": "Qwen3XML streaming has systematic issues",
65 "test_surrounding_text": "Qwen3XML streaming has systematic issues",
66 "test_escaped_strings": "Qwen3XML streaming has systematic issues",
67 - "test_malformed_input": (
68 - "Qwen3XML parser is lenient with malformed input"
69 - ),
67 "test_streaming_reconstruction": (
68 "Qwen3XML streaming reconstruction has known issues"
69 ),
vllm/tool_parsers/qwen3xml_tool_parser.py
+7 -4
@@ -1258,11 +1258,11 @@ class Qwen3XMLToolParser(ToolParser):
1258 return None
1259
1260 # Parse the delta text and get the result
1261 - result = self.parser.parse_single_streaming_chunks(delta_text)
1261 + delta = self.parser.parse_single_streaming_chunks(delta_text)
1262
1263 # Update tool call tracking arrays based on incremental parsing results
1264 - if result and result.tool_calls:
1265 - for tool_call in result.tool_calls:
1264 + if delta and delta.tool_calls:
1265 + for tool_call in delta.tool_calls:
1266 if tool_call.function:
1267 tool_index = (
1268 tool_call.index
@@ -1292,4 +1292,7 @@ class Qwen3XMLToolParser(ToolParser):
1292 self.streamed_args_for_tool[tool_index] += (
1293 tool_call.function.arguments
1294 )
1295 - return result
1295 + if delta.content is None and not delta.tool_calls and delta.reasoning is None:
1296 + # If no content and no tool calls, return None to indicate no update
1297 + return None
1298 + return delta