Repository navigation
parser: bypass tool parser for no-tools streams - #29
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesNo-tools tool-parser bypass
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes a GLM-5.2 streaming corruption where plain post-reasoning content was routed through the tool parser even when the request did not provide any tools.
With
--enable-auto-tool-choice, vLLM constructs a tool parser globally. After</think>,DelegatingParser._in_tool_call_phase()became true whenever that parser existed, regardless of whether the request had atoolslist. For no-tools requests, the engine-based tool parser can re-emit buffered plain content and duplicate fragments in streamed deltas.Observed on GLM-5.2 NVFP4/B12X MTP3 long-context streaming:
This produced client-visible code corruption such as:
Changes
DelegatingParser.request.toolsis empty/missing.Validation
python3 -m py_compile vllm/parser/abstract_parser.py tests/parser/engine/test_parser_engine.pygit diff --check/mnt/test.pylong-context streaming iterations passed without theif limit < ... limit <corruption.Note: upstream vLLM PR vllm-project#46149 fixes a related but separate forced/named tool-choice + reasoning grammar issue. This PR intentionally does not include that change.
Summary by CodeRabbit