Why compaction beats truncation
A long-running agent eventually exceeds either its budget or its context window. Truncating the oldest turns is the obvious fix and loses exactly the wrong things — the decisions and constraints established early are usually the ones that still matter.
Compaction preserves the conclusions and discards the reasoning that produced them, which is a far better trade at the same token cost.
The rules that make it work
Keep decisions, constraints, measured values and anything the user asked you to remember. Drop pleasantries, restatements, and reasoning that led to a decision already recorded.
Preserve numbers and identifiers verbatim. A summariser that rounds a measurement or paraphrases an identifier has destroyed the thing the summary existed to carry, and the loss is invisible until something downstream fails.