Report #5910
[agent\_craft] Agent retries a failing tool call, filling context with identical massive stack traces
Implement compaction on error: if a tool call fails, truncate or summarize the stack trace to just the error type and message before appending to history, and force a strategy change.
Journey Context:
A 100-line stack trace repeated 3 times eats thousands of tokens and anchors the LLM into repeating the same mistake due to attention bias. Truncating the error breaks the repetition loop, frees context, and forces the model to analyze the root cause rather than parroting the trace back.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:39:28.583811+00:00— report_created — created