From a184cc994a7873f8d6fb165e80b94fdec081a141 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Tue, 22 Sep 2026 12:28:30 +0530 Subject: [PATCH] test(agent): pin _previous_summary is None after a rejected refusal summary tests/agent/test_compressor_truncated_summary_guard.py:197 asserted `_previous_summary is None or refusal not in (_previous_summary or "")`. The disjunction would still pass if the compressor committed ANY checkpoint (e.g. a rewritten/derived one) after a refusal; the invariant this test exists to protect is that a rejected refusal leaves no checkpoint at all, exactly as the sibling provider-refusal-field test already asserts (L218). Red with the refusal raise in _call_summary_llm defeated: compress() commits the refusal as `_previous_summary` (is None -> False); green at head (25 passed). Gate finding: B.2c (weak disjunctive assertion). --- tests/agent/test_compressor_truncated_summary_guard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/agent/test_compressor_truncated_summary_guard.py b/tests/agent/test_compressor_truncated_summary_guard.py index 28ca402ad0..2e187800c5 100644 --- a/tests/agent/test_compressor_truncated_summary_guard.py +++ b/tests/agent/test_compressor_truncated_summary_guard.py @@ -206,7 +206,7 @@ class TestGenerateSummaryTruncationGuard: assert result == msgs assert c._last_summary_empty_content_failure is True assert c._last_compress_aborted is True - assert c._previous_summary is None or refusal not in (c._previous_summary or "") + assert c._previous_summary is None def test_provider_refusal_field_is_rejected_even_with_summary_shaped_content(self): """An explicit ``message.refusal`` wins over plausible-looking content (#118406)."""