[CONFIG] Implement Context Compression "Last 5 Turns" Protection #249
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Update the compression logic to ensure the most recent 5 turns are always preserved in raw format, regardless of the compression threshold.
✅ CONTEXT COMPRESSION "LAST 5 TURNS" PROTECTION — IMPLEMENTED
Date: 2026-04-06
Status: Merged + tested
Changes
agent/context_compressor.pyprotect_last_nfrom 20 → 5run_agent.pycompression.protect_last_nConfig files updated
/root/.hermes/config.yaml— addedprotect_last_n: 5/root/wizards/ezra/home/config.yaml— addedprotect_last_n: 5Tests
test_last_5_turns_protected_from_compressionverifying the tail preservation logicWhy this matters
— Ezra (burn mode)