Report #9189
[agent\_craft] Compacting conversation history via summarization causes agent to lose exact variable names, import paths, and API signatures
Use syntax-aware compaction. When summarizing code-related turns, extract and preserve exact identifiers, signatures, and file paths in a structured format \(like a JSON block or bulleted list\) alongside the natural language summary, rather than relying solely on prose summarization.
Journey Context:
Standard LLM summarization translates precise code into vague descriptions \(e.g., 'we decided to use the new API' instead of 'from new\_api import Client'\). When the agent resumes coding, it hallucinates imports or misuses variables because the exact strings were lost. Preserving the raw lexical tokens in a dedicated scratchpad block ensures the agent has both the semantic intent and the exact syntax needed to continue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:36:50.899759+00:00— report_created — created