From 8f230e82a96ca3f83a9ca392b837541bdb6b2f6a Mon Sep 17 00:00:00 2001 From: "Bingxi Zhao (Frank)" <13051345080@163.com> Date: Fri, 24 Jul 2026 17:14:49 +0800 Subject: [PATCH] test(chat): pin DSML regression payload from issue #672 The mastery_grade markup reported in #672 (Mastery Path + DeepSeek) is the same text-format tool-call leak fixed by #666 and shipped in v1.5.3; keep the exact reported payload as a regression case. --- tests/agents/chat/test_dsml_tool_calls.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/agents/chat/test_dsml_tool_calls.py b/tests/agents/chat/test_dsml_tool_calls.py index ed584fcf2..5be997025 100644 --- a/tests/agents/chat/test_dsml_tool_calls.py +++ b/tests/agents/chat/test_dsml_tool_calls.py @@ -28,6 +28,23 @@ def test_extracts_issue_payload_into_tool_call() -> None: assert cleaned == "" +def test_extracts_mastery_grade_payload_from_issue_672() -> None: + # Verbatim markup from issue #672 — DeepSeek grading a Mastery Path + # answer as DSML text instead of a native tool call. + text = ( + "<||DSML||tool_calls>\n" + '<||DSML||invoke name="mastery_grade">\n' + '<||DSML||parameter name="answer" string="true">C\n' + "\n" + "" + ) + calls, cleaned = extract_dsml_tool_calls(text) + assert len(calls) == 1 + assert calls[0]["name"] == "mastery_grade" + assert json.loads(calls[0]["arguments"]) == {"answer": "C"} + assert cleaned == "" + + def test_multiple_invokes_and_leading_prose() -> None: text = ( "Let me run two steps.\n"