Report #73901
[agent\_craft] Agent hallucinates incorrect fixes or enters infinite loops when presented with raw, verbose stack traces
Parse and categorize errors before presenting to LLM: classify as SyntaxError, ImportError, NameError, TypeError, or TestFailure, then provide only the error type, the relevant user-code line, and the message, stripping framework internals
Journey Context:
Raw stack traces contain noisy frames from standard libraries, decorators, and test runners that confuse the LLM about where the actual bug resides. When shown full traces, agents often 'fix' framework code or modify the wrong function. The SWE-agent ACI \(Agent-Computer Interface\) research shows that compressing error messages by extracting only the error type and the line in user-controlled code reduces hallucination rates. By categorizing errors \(syntax vs runtime vs logic\), the agent can also select different recovery strategies: syntax errors trigger parsing fixes, import errors trigger dependency checks, test failures trigger test-specific debugging. This trades the 'richness' of full traces for actionable, structured error signals.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:38:29.209263+00:00— report_created — created