Report #56909
[agent\_craft] Summarizing conversation history loses exact tool call schemas, code snippets, and structured outputs needed for subsequent steps
When compacting context through summarization, preserve verbatim: \(1\) the most recent N tool call/result pairs in full, \(2\) any code the agent has written or modified, \(3\) exact file paths and line numbers referenced, \(4\) the current task state. Only summarize the agent's reasoning and exploration narrative. Never summarize across structured data boundaries — keep the original schema intact.
Journey Context:
Agents that run for many turns need to compact their context to stay within window limits. The standard approach is to summarize older turns. But naive summarization is lossy in dangerous ways: it rounds off exact function signatures, mangles code indentation, loses precise file paths, and conflates tool output structure into prose. When the agent then tries to make a subsequent tool call based on the summary, it uses the wrong parameter names, incorrect paths, or malformed syntax — and the call fails. This creates a compaction-death spiral: the agent fails, retries with slightly different but still wrong parameters, generates more context, needs more compaction, and the cycle continues. The MemGPT architecture addresses this by maintaining separate memory tiers with different compaction policies: the working memory \(core context\) is never summarized, while conversational memory can be compressed. The key insight is that not all context is equally compressible — structured data \(code, tool schemas, JSON\) is high-entropy and must be preserved verbatim, while natural language reasoning is low-entropy and compresses well.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:00:45.182098+00:00— report_created — created