compressor: target hysteresis — shrink to 65% after compression, not just below the trigger
Compression triggered at 90% but left the context just under the trigger, so a
fixed keep_recent (navi_code: 12 turns ≈ 104 messages) re-triggered a couple
of messages later — the context yo-yoed at the trigger line instead of gaining
headroom. Add context_compression_target (0.65): in turn-based (preturn) mode
compress_context shrinks keep_recent until the verbatim kept region fits 65% of
the window, folding the extra turns into the same single summary LLM call; a
safety net in compress_session token-budget-truncates if the kept region alone
still exceeds the target (midturn kept a huge in-flight turn, or the
keep_recent floor can't fit). Trigger 90% → target 65% leaves real headroom.
1 parent 8e3570b commit 55fa7ae848bec476ff3a3e31ef509bdf56e53067
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 13 hours ago
Showing 3 changed files
View
navi/config.py
View
navi/core/compressor.py
View
tests/unit/core/test_compressor.py