[Bugfix] Drop incomplete tool-call markup in non-streaming to match streaming (#47562)

Signed-off-by: Suvrakamal Das <jyb2084.usa@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Ben Browning <56071+bbrowning@users.noreply.github.com>
This commit is contained in:
Suvrakamal Das
2026-09-01 18:11:36 +00:00
committed by GitHub
co-authored by Claude Ben Browning
parent 2f01039666
commit e7cf4730d6
6 changed files with 399 additions and 1 deletions
+17
View File
@@ -150,6 +150,15 @@ class ParserEngineToolAdapter(ToolParser):
state so it can parse reasoning-stripped content (i.e. the output of
:meth:`ReasoningParser.extract_reasoning`).
When no reasoning parser is configured at the serving layer, the
owning :class:`~vllm.parser.abstract_parser.Parser` sets
:attr:`skip_reasoning_parsing` so reasoning markup — plain content
in that configuration — passes through verbatim instead of being
consumed or reclassified by the engine. The engine honors the flag
only for markers that are reasoning-exclusive in its config; a
grammar like Inkling, whose block closer is shared with text and
tool blocks, keeps parsing unchanged.
Subclasses set :attr:`_parser_engine_cls` to the concrete
:class:`ParserEngine` class.
"""
@@ -166,6 +175,14 @@ class ParserEngineToolAdapter(ToolParser):
super().__init__(tokenizer, tools)
self._parser_engine = self._parser_engine_cls(tokenizer, tools, **kwargs) # type: ignore[call-arg]
@property
def skip_reasoning_parsing(self) -> bool:
return self._parser_engine.skip_reasoning_parsing
@skip_reasoning_parsing.setter
def skip_reasoning_parsing(self, value: bool) -> None:
self._parser_engine.skip_reasoning_parsing = value
def adjust_request(
self,
request: ChatCompletionRequest | ResponsesRequest,