Report #12530
[agent\_craft] Pasting entire massive stack traces into the context window when a tool fails
Pre-process errors. Extract only the exception type, message, and the specific line of code that failed before returning the error to the agent's context.
Journey Context:
A 200-line stack trace is mostly noise for an LLM; it just needs to know what failed and where. Injecting the full trace wastes context and dilutes attention on the actual bug. A simple wrapper around tool execution that catches exceptions and formats them concisely saves thousands of tokens and focuses the agent on the fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:15:36.784477+00:00— report_created — created