Three-layer cascade
CompactBoundary
After each compression, a boundary marker is inserted into the conversation:What is never compressed away
- Active tool calls and their results (current turn)
- The last 5 messages with substantive text content
- Memories injected at session start
- The user’s profile context
- Any content marked with a “must-retain” pre-compression hook
When compression triggers
Compression is fully automatic. It triggers when the active context window approaches the model’s limit. You don’t need to manage it, restart sessions, or summarize manually.Sessions can run for hours across dozens of tool calls without hitting limits. The compression engine handles it invisibly.