Report #7901
[agent\_craft] LLM summarization strips exact identifiers needed for subsequent code generation
When compacting context, use structured templates \(e.g., 'Current State: \{vars\}, Last Error: \{exact\_string\}'\) or extractive methods rather than pure abstractive summarization for code-related context.
Journey Context:
Abstractive summarization is great for prose but terrible for code. An LLM summarizing a traceback or a list of defined functions will hallucinate or generalize names \(e.g., changing \`process\_user\_req\` to \`process\_request\`\), breaking downstream code generation. Agents try to save tokens by asking the LLM to 'summarize the conversation', but this destroys the exact string matching required for tool use and code compilation. The tradeoff is slightly higher token usage for structured extraction, but it guarantees syntactic validity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:07:31.775354+00:00— report_created — created