Report #15828
[agent\_craft] Agent context fills up with repetitive, massive stack traces from failed shell commands or test runs, causing it to lose track of the original goal
Truncate and summarize tool error outputs before inserting them back into context. Keep only the first and last few lines of a stack trace, or extract the specific error type and message, discarding the intermediate frames.
Journey Context:
A failed npm test can output thousands of lines. The LLM doesn't need the entire internal Node.js stack trace, just the assertion error and the file/line. Truncating tool outputs prevents context rot and saves tokens, while preserving the diagnostic signal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:12:25.910429+00:00— report_created — created