Skip to content

[Bugfix] [Parser] Fix Qwen3 latent bug in partial params dropping values containing <#46047

Merged
sfeng33 merged 1 commit into
vllm-project:mainfrom
bbrowning:qwen-parser-angle-bracket
Jun 18, 2026
Merged

[Bugfix] [Parser] Fix Qwen3 latent bug in partial params dropping values containing <#46047
sfeng33 merged 1 commit into
vllm-project:mainfrom
bbrowning:qwen-parser-angle-bracket

Conversation

@bbrowning

Copy link
Copy Markdown
Collaborator

Purpose

In the new Qwen3 parser, _PARTIAL_PARAM_RE used [^<]*$ to capture in-progress parameter content. When a value contained a literal < (HTML, code, math like x<5), the regex failed to match entirely. In practice this appears to be handled gracefully by the holdback mechanism. But, it is a latent bug even though I have not been able to trigger that in the real world so far outside of the unit tests here. There could be some specific scenario of generated arguments that triggers this in a live server, so better to clean this up before users hit it.

Fix by changing [^<]*$ to (.*)$ so the capture group accepts any character including <.

Test Plan

Unit Tests

I added a couple unit tests specifically to reproduce. The test plan below runs those as well as all other parser engine, qwen3 and nemotron_v3 reasoning tests (because the nemotron parser inherits from the qwen one).

pytest -v \
  tests/parser/engine/ \
  tests/reasoning/test_qwen3_reasoning_parser.py \
  tests/reasoning/test_nemotron_v3_reasoning_parser.py \
  tests/tool_parsers/test_qwen3coder_tool_parser.py

Test Result

Unit Tests

1762 passed, 2 warnings
…ining <

_PARTIAL_PARAM_RE used [^<]*$ to capture in-progress parameter content.
When a value contained a literal < (HTML, code, math like x<5), the
regex failed to match entirely, silently dropping the parameter during
streaming.

Fix by changing [^<]*$ to (.*)$ so the capture group accepts any
character including <.

Co-Authored-By: Claude <noreply@anthropic.com>

Signed-off-by: Ben Browning <bbrownin@redhat.com>
@mergify mergify Bot added qwen Related to Qwen models tool-calling bug Something isn't working labels Jun 18, 2026
@sfeng33 sfeng33 added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 18, 2026
@sfeng33 sfeng33 enabled auto-merge (squash) June 18, 2026 15:31
@sfeng33 sfeng33 merged commit 09f3cd5 into vllm-project:main Jun 18, 2026
57 checks passed
@bbrowning bbrowning deleted the qwen-parser-angle-bracket branch June 18, 2026 18:24
divineearthly pushed a commit to divineearthly/vllm that referenced this pull request Jun 19, 2026
…ues containing `<` (vllm-project#46047)

Signed-off-by: Ben Browning <bbrownin@redhat.com>
Signed-off-by: divineearthly <divineearthly@gmail.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Jun 21, 2026
…ues containing `<` (vllm-project#46047)

Signed-off-by: Ben Browning <bbrownin@redhat.com>
tunglinwood pushed a commit to tunglinwood/vllm that referenced this pull request Jun 22, 2026
…ues containing `<` (vllm-project#46047)

Signed-off-by: Ben Browning <bbrownin@redhat.com>
nkzhenhua pushed a commit to nkzhenhua/vllm that referenced this pull request Jun 24, 2026
…ues containing `<` (vllm-project#46047)

Signed-off-by: Ben Browning <bbrownin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed tool-calling

2 participants