Report #12265
[agent\_craft] Agent context degrades from repetitive, long stack traces during debugging loops
Programmatically truncate or summarize failed execution outputs, keeping only the specific error type and message, while preserving the full output of successful executions.
Journey Context:
When an agent is in a debugging loop, it might run a test 5 times. Each failure outputs 100 lines of identical stack trace. The context becomes 90% redundant error text, causing the agent to lose track of the actual code. By intercepting tool outputs and stripping the repetitive trace, you maintain a high signal-to-noise ratio. The agent only needs the error name and line number to adjust its fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:37:54.368738+00:00— report_created — created