|
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. |
|---|
|
|
| navi/config.py |
|---|
| navi/core/compressor.py |
|---|
| tests/unit/core/test_compressor.py |
|---|