From 4275e5d6db9156b453d337f144dbb39f7ae53c78 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Thu, 1 Oct 2026 17:13:31 +0530 Subject: [PATCH] test(compression): keep two invariant tests for the reply-pointer split Trim the salvaged tests to the two that pin the headline behaviour: a short reply to a long answer still splits the oversized turn (reply, own-reply and Discord-note pointers), and a restated reply keeps splitting on later compactions. The snapshot and helper-table tests restate implementation details already exercised by those two end-to-end paths. --- tests/agent/test_split_turn_compaction.py | 25 ----------------------- 1 file changed, 25 deletions(-) diff --git a/tests/agent/test_split_turn_compaction.py b/tests/agent/test_split_turn_compaction.py index 92849bb5e6..58d132337f 100644 --- a/tests/agent/test_split_turn_compaction.py +++ b/tests/agent/test_split_turn_compaction.py @@ -368,31 +368,6 @@ def test_restated_reply_keeps_splitting_on_later_compactions() -> None: messages.extend(_tool_group(100 * (cycle + 1) + index)) -def test_task_snapshot_keeps_the_request_not_the_reply_quote() -> None: - """Head elision of a long reply row used to keep only the quote and drop the request.""" - snapshot = ContextCompressor._latest_user_task_snapshot( - [{"role": "user", "content": _gateway_reply("please fix the parser")}] - ) - assert snapshot is not None - assert "please fix the parser" in snapshot - assert "Earlier assistant answer" not in snapshot - - -@pytest.mark.parametrize( - "content, expected", - [ - (_ACTIVE_REQUEST, _ACTIVE_REQUEST), - ('[Replying to: "a"]\n\n', '[Replying to: "a"]'), - ('[Replying to: "q"]\n\nsays "x"]\n\n in code"]\n\ngo', 'says "x"]\n\n in code"]\n\ngo'), - (f'{_INFLIGHT_TASK_REPLAY_HEADER}\n[Replying to: "q"]\n\ngo', "go"), - (f'I quoted it:\n[Replying to: "q"]\n\ngo', 'I quoted it:\n[Replying to: "q"]\n\ngo'), - ], - ids=["no-pointer", "pointer-only", "quote-with-delimiter", "after-replay-header", "not-leading"], -) -def test_authored_request_text_never_strips_user_text(content: str, expected: str) -> None: - assert _authored_request_text(content) == expected - - @pytest.mark.parametrize( "payload, can_split", [