"""Unit tests for chat context window compaction trigger thresholds.""" import pytest def test_compaction_trigger_on_message_count(): """Verify compaction triggers when message turns exceed threshold.""" def needs_compaction(turn_count: int, max_turns: int = 20) -> bool: return turn_count >= max_turns assert needs_compaction(12) is False assert needs_compaction(20) is True assert needs_compaction(25) is True