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).
This commit is contained in:
kshitijk4poor
2026-09-22 12:28:30 +05:30
committed by kshitij
parent 94fbc155ec
commit a184cc994a

View File

@@ -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)."""