Report #85597
[agent\_craft] Agent loops infinitely trying to fix a bug because it only sees a truncated error message missing the root cause
When encountering an error, use a tool to extract the \*final\* exception type and message, plus the specific stack frames belonging to the user's code, discarding framework internals. Feed this targeted slice to the agent.
Journey Context:
Standard truncation \(e.g., first/last N lines\) often cuts out the actual user-code stack trace in favor of verbose framework traces \(like Django or React internals\). The agent needs to know \*where\* in the user's code the error occurred. By programmatically parsing the traceback and filtering for local files, you give the agent exactly the signal it needs without the noise, preventing infinite loops based on incomplete information.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:15:53.641792+00:00— report_created — created