Skip to content

fix: avoid crash on zero-arg tool calls in glm4 parser#32321

Merged
chaunceyjiang merged 1 commit intovllm-project:mainfrom
seekskyworld:fix/32213-glm4-tool-parser-no-args
Jan 15, 2026
Merged

fix: avoid crash on zero-arg tool calls in glm4 parser#32321
chaunceyjiang merged 1 commit intovllm-project:mainfrom
seekskyworld:fix/32213-glm4-tool-parser-no-args

Conversation

@seekskyworld
Copy link
Copy Markdown
Contributor

@seekskyworld seekskyworld commented Jan 14, 2026

Issue

Summary

  • Guard tool call detail parsing to avoid crashing on unmatched patterns.
  • Treat missing arg groups as empty so zero-arg tool calls parse cleanly.

Motivation

  • Zero-argument tool calls can yield None for the arg group, which used to
    trigger a TypeError and drop tool calls.

Validation

  • Manual: C:\vllm-venv\Scripts\python - with <tool_call>get_current_time</tool_call>
    using glm47 parser → tools_called=True, arguments {}.
  • Manual: same snippet with glm4 parser → no exception (warning only).

@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

Signed-off-by: seekskyworld <djh1813553759@gmail.com>
@seekskyworld seekskyworld force-pushed the fix/32213-glm4-tool-parser-no-args branch from efed4fc to 01c680a Compare January 14, 2026 09:40
@chaunceyjiang chaunceyjiang self-assigned this Jan 14, 2026
Copy link
Copy Markdown
Collaborator

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

LGTM

@chaunceyjiang chaunceyjiang added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 15, 2026
@chaunceyjiang chaunceyjiang enabled auto-merge (squash) January 15, 2026 06:54
@chaunceyjiang chaunceyjiang merged commit a52d139 into vllm-project:main Jan 15, 2026
47 checks passed
sammysun0711 pushed a commit to sammysun0711/vllm that referenced this pull request Jan 16, 2026
…32321)

Signed-off-by: seekskyworld <djh1813553759@gmail.com>
akh64bit pushed a commit to akh64bit/vllm that referenced this pull request Jan 16, 2026
…32321)

Signed-off-by: seekskyworld <djh1813553759@gmail.com>
dsuhinin pushed a commit to dsuhinin/vllm that referenced this pull request Jan 21, 2026
…32321)

Signed-off-by: seekskyworld <djh1813553759@gmail.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
…32321)

Signed-off-by: seekskyworld <djh1813553759@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

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]: GLM4 tool parser crashes with TypeError when parsing tools with no arguments

2 participants