vllm - 💡(How to fix) Fix [Bug]: Tool call leaks into content [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#40911Fetched 2026-04-27 05:29:23
View on GitHub
Comments
3
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×3subscribed ×2labeled ×1mentioned ×1
RAW_BUFFERClick to expand / collapse

Your current environment

see source link

🐛 Describe the bug

https://github.com/vllm-project/vllm/blob/9558f43903faa1b6db08ac98802bf88111196345/vllm/parser/abstract_parser.py#L621

When transitioning from reasoning to tool call with e.g. gemma4, "current_text" can contain parts of the tool call token like "<|". If this happens, the call is not recognized and leaks into the content.

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

extent analysis

TL;DR

The issue can be fixed by properly handling the "current_text" variable to prevent it from containing parts of the tool call token when transitioning from reasoning to tool call.

Guidance

  • Review the code at the specified line in abstract_parser.py to understand how "current_text" is being updated and ensure it is correctly reset or cleaned up before making a tool call.
  • Verify that the tool call recognition logic is correctly implemented and that the presence of "<|" in "current_text" is the root cause of the issue.
  • Consider adding a check or a cleanup step before making a tool call to remove any unwanted characters from "current_text".
  • Investigate if there are any existing functions or methods in the abstract_parser.py file that can be used to sanitize or normalize the "current_text" variable.

Notes

The provided information does not include the exact code changes or the desired behavior of the tool call recognition logic, so a precise fix cannot be provided.

Recommendation

Apply workaround: Implement a cleanup step to remove any unwanted characters from "current_text" before making a tool call, as this seems to be the most direct way to address the issue based on the provided information.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - 💡(How to fix) Fix [Bug]: Tool call leaks into content [3 comments, 2 participants]