Skip to content

[Bugfix] fix Qwen3.5 tool calling bug#36774

Merged
DarkLight1337 merged 3 commits intovllm-project:mainfrom
chaunceyjiang:qwen3.5_tool_bug
Mar 16, 2026
Merged

[Bugfix] fix Qwen3.5 tool calling bug#36774
DarkLight1337 merged 3 commits intovllm-project:mainfrom
chaunceyjiang:qwen3.5_tool_bug

Conversation

@chaunceyjiang
Copy link
Collaborator

@chaunceyjiang chaunceyjiang commented Mar 11, 2026

Purpose

FIX #36769

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@mergify mergify bot added qwen Related to Qwen models bug Something isn't working labels Mar 11, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request fixes a tool calling bug in Qwen3.5 by making the XML parsing more robust. The change from index() to find() prevents crashes on malformed input, and the logic for determining if tools were called is now more accurate. However, I've identified a critical issue where the list of tool calls returned to the caller can contain None values, which violates the expected data schema and can lead to runtime errors. I've provided a detailed comment with suggestions to fix this.

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@chaunceyjiang chaunceyjiang marked this pull request as ready for review March 12, 2026 07:20
@chaunceyjiang chaunceyjiang requested a review from aarnphm as a code owner March 12, 2026 07:20
@chaunceyjiang
Copy link
Collaborator Author

/cc @sfeng33 PTAL.

@chaunceyjiang chaunceyjiang added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 12, 2026
Copy link
Contributor

@sfeng33 sfeng33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM, thanks for the fix.

@chaunceyjiang
Copy link
Collaborator Author

/cc @DarkLight1337 PTAL.

@DarkLight1337 DarkLight1337 merged commit 8d3f8f4 into vllm-project:main Mar 16, 2026
42 checks passed
Lucaskabela pushed a commit to Lucaskabela/vllm that referenced this pull request Mar 17, 2026
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
wendyliu235 pushed a commit to wendyliu235/vllm-public that referenced this pull request Mar 18, 2026
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
fxdawnn pushed a commit to fxdawnn/vllm that referenced this pull request Mar 19, 2026
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
bbrowning added a commit to bbrowning/vllm that referenced this pull request Mar 26, 2026
Audited recent tool parser bug-fix PRs and found that several
landed without corresponding test coverage. Added unit tests
for each fix to prevent regressions.

- Mistral: fast detokenization text detection (PR vllm-project#37209)
- Qwen3Coder: malformed XML crash, anyOf double-encoding,
  speculative decode streaming (PRs vllm-project#36774, vllm-project#36032, vllm-project#35615)
- DeepSeekV32: delimiter preservation with fast detokenization,
  skip_special_tokens adjustment (PR vllm-project#33964)
- GLM-4 MoE: zero-argument tool calls, transformers 5.x delimiter
  handling, Unicode character preservation (PRs vllm-project#32321, vllm-project#31622, vllm-project#30920)
- MiniMax M2: anyOf nullable parameter handling for non-null and
  null values (PR vllm-project#32342)
- Step3p5: MTP-style variable-chunk and multi-token streaming
  (PR vllm-project#33690)
- Kimi K2: native tool call ID extraction and multi-turn ID
  continuity (PR vllm-project#32768)

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Qwen3.5 tool calling bug

3 participants