Spaces:
Sleeping

studiq-backend / tests /test_context_window.py
StudIQ Auto Deploy Daemon
Auto deploy: Tue Oct 27 11:23:50 IST 2026
9f7b159
Raw History Blame Contribute Delete
444 Bytes
"""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