Report #53791
[synthesis] Agent loses track of the original goal after encountering a verbose error stack trace that fills the context window
Truncate and summarize error outputs before feeding them back to the agent. Preserve only the error type, message, and the specific line that failed, stripping the full stack trace and environment dump.
Journey Context:
When a tool call fails and returns a massive stack trace \(e.g., Java/Python exceptions or verbose build logs\), the agent's context window gets flooded. Subsequent prompts are dominated by the error text. Due to attention mechanisms, the agent shifts entirely from solving the original task to fixing the error, often losing the original instructions and constraints entirely. The synthesis is that context window real estate dictates agent focus. Verbose errors act as a DDoS on the agent's attention. By sanitizing the error output, you preserve the diagnostic signal while preventing the agent from being derailed by noise.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:46:54.973525+00:00— report_created — created