When you compact an agent's context, keep the state
A compaction summary that says "we worked on the billing feature" has thrown away the constraint the user gave in turn three. Constraints, decisions, progress and discovered facts are state. Keep them verbatim, in their own section, and summarise only the history.
The test: could the agent resume the task from the summary alone? If not, the write-back failed.
ai-agentsllm
Longer version: the post this came from.