[Bugfix] Fix VLLM_ENFORCE_STRICT_TOOL_CALLING mutation in tests (#49846)

Signed-off-by: Yifan Zong <yzong@redhat.com>
This commit is contained in:
yzong-rh
2026-07-27 16:12:14 +00:00
committed by GitHub
parent 04502deca2
commit 3f47a8384d
3 changed files with 26 additions and 44 deletions
+8
View File
@@ -14,6 +14,14 @@ from vllm.reasoning.basic_parsers import BaseThinkingReasoningParser
from vllm.tool_parsers.hermes_tool_parser import Hermes2ProToolParser
@pytest.fixture(autouse=True)
def enable_hermes_required_named_parsing(monkeypatch):
# With VLLM_ENFORCE_STRICT_TOOL_CALLING (default on), Hermes sets
# supports_required_and_named=False and uses structural-tag guided tool
# calling. Force it True to test the non-guided JSON required/named parse path.
monkeypatch.setattr(Hermes2ProToolParser, "supports_required_and_named", True)
class ThinkReasoningParser(BaseThinkingReasoningParser):
@property
def start_token(self) -> str: