Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/parser/engine/test_deepseek_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ def test_string_true_not_json_parsed(self):
assert result["n"] == "42"
assert isinstance(result["n"], str)

def test_partial_closing_tag_not_leaked(self):
# Regression test for issue #53227: partial DSML tags leak into arguments
raw = (
'<|DSML|parameter name="location" string="true">Paris</|DSML|parameter'
)
result = json.loads(_dsml_arg_converter(raw, partial=True))
assert result == {"location": "Paris"}


# ── Bare </think> absorption and duplicate <think> absorption ─────────

Expand Down
2 changes: 1 addition & 1 deletion vllm/parser/deepseek_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
)
_PARTIAL_PARAM_RE = re.compile(
rf'<{_ESCAPED_DSML}parameter\s+name="([^"]+)"\s+string="(true|false)">'
rf"(.*)$",
rf"((?:(?!</?{_ESCAPED_DSML}).)*)",
re.DOTALL,
)

Expand Down
Loading