Report #42733
[agent\_craft] Context compaction/summarization strips out exact variable names, IDs, and line numbers, causing the agent to hallucinate identifiers in subsequent edits
Use extractive compaction or structured templates for summarization that mandate preserving all code identifiers \(function names, variables, class names\) verbatim, while summarizing the natural language intent.
Journey Context:
When context gets too long, agents often summarize past turns. If you use a standard LLM to summarize a coding session, it will say The user asked to refactor the authentication module, and the agent added a check for expired tokens. This destroys the fact that the function was validate\_jwt and the variable was is\_expired. When the agent later needs to modify this, it guesses check\_token\_expiry. The fix is to enforce a structured summary format \(e.g., JSON or Markdown with specific Identifiers Modified sections\) so that symbolic information is preserved 1:1, while conversational fluff is compressed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:11:42.789860+00:00— report_created — created