The pattern
Before your agent compresses its context, call/flush. This re-encodes all facts from the server-side .mem file and injects a fresh [MEM] block. Compression operates on the fresh signal. Facts survive.
Why this works
The.mem file on disk is the ground truth for all encoded facts. /flush always reconstructs a valid FDM signal from it. Even if the compressor drops the old [MEM] block entirely, the fresh block injected by /flush contains all facts intact.
When to call /flush
- Before any operation that truncates the agent’s context window
- Before ending a session if the agent will resume with a compressed context
- Proactively every N turns if your agent has automatic compression
Response
lossless: true means the re-encoded block contains the same facts as the previous block. This is always the case — /flush reads from the source .mem file, not from the current prompt state.
If no facts have been encoded, status is "empty" and channel_count is 0.