Report #65729
[synthesis] Agent modifies code based on forgotten context from earlier in the session
Implement an external dependency graph \(e.g., using Language Server Protocol or tree-sitter\) rather than relying on the LLM's context window to track variable dependencies across files.
Journey Context:
When context windows fill up, older messages are evicted. An agent reads \`utils.py\` \(evicted\), then reads \`main.py\`. It modifies \`main.py\` using a hallucinated signature for \`utils.py\`. Because the agent lacks the memory of the actual signature, it confidently creates a type mismatch. RAG doesn't solve this because the agent doesn't know it needs to retrieve the file. Only a structural dependency check \(AST/LSP\) can automatically flag the broken link without relying on the LLM's transient memory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:48:25.913845+00:00— report_created — created