From 74f8cdb0becdac5a11f15a5499ac5d7181d3ee75 Mon Sep 17 00:00:00 2001 From: xiaoan17 Date: Thu, 29 Oct 2026 14:07:58 +0800 Subject: [PATCH] test(chat): assert the preserved operator material in the native input PR #7549 stopped collapsing whitespace in the operator message, so the native model input now carries the original line breaks instead of a single collapsed line. The assertion in tests/test_lark_native_reply_context.py still matched the collapsed form and could no longer be satisfied by the shipped prompt. Assert against the recorded text blocks so the check states the preserved-material contract directly. Signed-off-by: xiaoan17 --- tests/test_lark_native_reply_context.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_lark_native_reply_context.py b/tests/test_lark_native_reply_context.py index 01917fa663..47c1a60b62 100644 --- a/tests/test_lark_native_reply_context.py +++ b/tests/test_lark_native_reply_context.py @@ -50,7 +50,10 @@ def test_native_reply_retains_exact_reference_and_original_authority(ordinary, g requests = [json.loads(line) for line in ordinary[4].read_text().splitlines()] native_input = next(request["params"]["input"] for request in requests if request["method"] == "turn/start") assert "local reading preview" in json.dumps(native_input) - assert "Current user message: Approved" in json.dumps(native_input) + # The original operator material reaches the model verbatim, including + # its own line breaks; the prompt is no longer whitespace-collapsed. + native_text = "".join(block.get("text", "") for block in native_input) + assert "Current user message:\nApproved" in native_text # The source and eventual return remain the same canonical conversation. transport.reconcile() assert all(profile == "notes-app" for profile, _ in provider.writes)