From 989d4ea43d8fd59f022db00303b2eae14f10ab3a Mon Sep 17 00:00:00 2001 From: Teknium Date: Wed, 8 Apr 2026 20:19:12 -0700 Subject: [PATCH] fix: set compression_count on mock to avoid TypeError in test The new degradation warning reads compression_count as an int, but the existing test's MagicMock returns a MagicMock object for that attribute, causing '>=' comparison to fail. --- tests/run_agent/test_context_pressure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/run_agent/test_context_pressure.py b/tests/run_agent/test_context_pressure.py index 522603fdb5f..a946ddd9cb1 100644 --- a/tests/run_agent/test_context_pressure.py +++ b/tests/run_agent/test_context_pressure.py @@ -219,6 +219,7 @@ class TestContextPressureFlags: ] agent.context_compressor.context_length = 200_000 agent.context_compressor.threshold_tokens = 100_000 + agent.context_compressor.compression_count = 1 agent._todo_store = MagicMock() agent._todo_store.format_for_injection.return_value = None