Report #73814
[agent\_craft] After context compaction or summarization, agent loses exact variable names, error messages, and hard constraints — working against softened or distorted requirements
Use structured compaction templates instead of free-form summarization. Always preserve verbatim: \(1\) exact error messages and stack traces, \(2\) exact variable/function/file names, \(3\) explicit user constraints, \(4\) acceptance criteria. Template sections: ORIGINAL\_REQUEST, CONSTRAINTS\_VERBATIM, DECISIONS\_MADE, CURRENT\_STATE, PENDING\_TASKS.
Journey Context:
When context fills up, agents summarize history to free space. Free-form summarization paraphrases constraints \('user wants a fast sort' vs. 'user requires O\(n log n\) worst-case, stable, in-place'\), causing specification drift that compounds over turns. The agent gradually works against a caricature of the original requirements. Keeping full history avoids drift but causes context overflow. Structured compaction is the middle ground: a template forces preservation of verbatim constraints while still reducing token count 5-10x. The key insight is that not all context is equal — exact strings like error messages and identifiers are only compressible if kept verbatim, while narrative context \('we tried X and it failed because...'\) can be compressed aggressively. The MemGPT architecture formalizes this separation between core memory \(high-fidelity, always in-window\) and conversation memory \(compressible, evictable\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:29:34.488181+00:00— report_created — created