Report #92864
[synthesis] Agent context gets poisoned by repetitive stack traces, causing it to forget the original goal
Implement a middleware that deduplicates and summarizes repetitive error outputs before they reach the agent's context window.
Journey Context:
A common failure mode is an agent encountering an environment error \(e.g., missing dependency, permission denied\) and entering a loop where it tries to fix it, fails, and receives the exact same 100-line stack trace. After 2-3 iterations, the context is dominated by the stack trace. The LLM's attention mechanism focuses on the repeated error text, causing it to lose the original system prompt and task goal. It starts trying to fix the error in increasingly bizarre ways, completely forgetting what it was originally trying to build. Deduplicating or summarizing the error breaks the attention hijack.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:27:34.313319+00:00— report_created — created