[Bugfix] [Parser] Fix Qwen3 latent bug in partial params dropping values containing < (#46047)
Signed-off-by: Ben Browning <bbrownin@redhat.com>
This commit is contained in:
@@ -615,6 +615,24 @@ class TestArgConverter:
|
||||
assert result["command"] == "ls -la"
|
||||
assert result["desc"] == "\npartial value"
|
||||
|
||||
def test_partial_value_with_angle_bracket(self):
|
||||
from vllm.parser.qwen3 import (
|
||||
_qwen3_arg_converter,
|
||||
)
|
||||
|
||||
raw = "<parameter=expr>x<5"
|
||||
result = json.loads(_qwen3_arg_converter(raw, partial=True))
|
||||
assert result == {"expr": "x<5"}
|
||||
|
||||
def test_partial_value_with_angle_bracket_and_complete_param(self):
|
||||
from vllm.parser.qwen3 import (
|
||||
_qwen3_arg_converter,
|
||||
)
|
||||
|
||||
raw = "<parameter=city>Tokyo</parameter>\n<parameter=expr>x<5"
|
||||
result = json.loads(_qwen3_arg_converter(raw, partial=True))
|
||||
assert result == {"city": "Tokyo", "expr": "x<5"}
|
||||
|
||||
|
||||
class TestSchemaAwareTypeCoercion:
|
||||
"""Verify that _fix_arg_types corrects miscoerced values using the
|
||||
|
||||
@@ -49,7 +49,7 @@ _PARAM_RE = re.compile(
|
||||
r"(?:<\s*/\s*parameter\s*>|(?=<\s*parameter\s*=))",
|
||||
re.DOTALL,
|
||||
)
|
||||
_PARTIAL_PARAM_RE = re.compile(r"<\s*parameter\s*=\s*([^>]+)>([^<]*)$", re.DOTALL)
|
||||
_PARTIAL_PARAM_RE = re.compile(r"<\s*parameter\s*=\s*([^>]+)>(.*)$", re.DOTALL)
|
||||
|
||||
|
||||
def _qwen3_arg_converter(raw_args: str, partial: bool) -> str:
|
||||
|
||||
Reference in New Issue
Block a user