Report #25116
[synthesis] Agent hallucinates non-existent files or APIs after an initial tool failure
Truncate or summarize failed tool outputs and stack traces before appending to context; do not carry full error text across steps.
Journey Context:
Agents anchor on the most recent context. A long stack trace from a failed tool call consumes the context window and introduces distracting tokens, causing the agent to fixate on the error text rather than the original goal. This leads to cascading hallucinations as it tries to 'fix' the error based on the trace. Truncating breaks the cascade.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:33:45.541953+00:00— report_created — created