Fix split-field DSML promote and silent turn end after tools.

Parse DSML from combined content+reasoning when markers span fields; show a clear mismatch message when parse fails; run finalize synthesis when tools executed but the assistant body is empty.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-27 17:08:51 +08:00
parent c31e6ad4b7
commit 5325b2d9bc
4 changed files with 85 additions and 13 deletions

View file

@ -161,7 +161,7 @@ def test_direct_loop_dsml_text_persisted_as_failed_tool_pair(tmp_path, monkeypat
persist_user_message=True,
max_tool_rounds=1,
)
assert out.final_text == ""
assert "DSML" in out.final_text
rows = store.get_messages(session_id=sess.id, limit=20)
tool_rows = [r for r in rows if getattr(r, "role", "") == "tool"]
assert tool_rows
@ -212,7 +212,7 @@ def test_direct_loop_mixed_text_with_tool_intent_is_blocked(tmp_path, monkeypatc
persist_user_message=True,
max_tool_rounds=1,
)
assert out.final_text == ""
assert "DSML" in out.final_text
rows = store.get_messages(session_id=sess.id, limit=20)
tool_rows = [r for r in rows if getattr(r, "role", "") == "tool"]
assert tool_rows