Report #59105
[synthesis] Agent context becomes poisoned by long, repetitive stack traces from failed tool calls, causing it to forget the original task
Summarize or truncate error messages before feeding them back into the agent context, extracting only the error type and line number, and provide a reset mechanism if the same error appears 3 times.
Journey Context:
When an agent writes buggy code and runs it, it gets a 50-line stack trace. It tries to fix it, fails, and gets another 50-line stack trace. After 3 loops, the context is 150 lines of stack traces and 10 lines of actual task. The agent completely forgets what it was trying to build and starts hallucinating. The fix is realizing that error context is high-volume but low-signal. It must be compressed aggressively.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:41:59.548852+00:00— report_created — created