diff --git a/tests/agent/test_context_compressor.py b/tests/agent/test_context_compressor.py index bfb749122a4..be3fcdf5ab1 100644 --- a/tests/agent/test_context_compressor.py +++ b/tests/agent/test_context_compressor.py @@ -2921,8 +2921,6 @@ class TestTurnPairPreservation: ) - - class TestSanitizerStripsOrphanedToolCalls: """PR #51218 (salvaged from #51225): orphaned tool_calls are stripped from assistant messages instead of having stub tool results inserted, avoiding @@ -2997,6 +2995,8 @@ class TestSanitizerStripsOrphanedToolCalls: asst = next(m for m in sanitized if m.get("role") == "assistant") assert asst["content"] == "Let me search for that." assert not asst.get("tool_calls") + # The placeholder must NOT overwrite existing text content. + assert asst["content"] != "(tool call removed)" def test_sanitizer_strips_orphaned_with_call_id_mismatch(self, compressor): """Stubs with call_id != id used to be dropped by downstream @@ -3025,8 +3025,6 @@ class TestSanitizerStripsOrphanedToolCalls: # No stub tool messages (which would have call_id != id mismatch) - - class TestCooldownReentryAbort: """Regression: a second compress() call during the failure cooldown must still abort when the original failure was a network/auth error. @@ -3106,8 +3104,6 @@ class TestCooldownReentryAbort: assert c._last_summary_fallback_used is False - - class TestDoubleCompactionSummaryRole: """PR #52160 (salvaged from #52167): when only the system prompt is protected, the summary must lead with role=user (Anthropic/Bedrock send