Errors Swept Under the Rug
Anti-pattern: scrub failed actions, stack traces, and error observations from the agent's own context so the trace looks clean, leaving the model with no evidence of what did not work.
Problem
The error message, stack trace, or rejection reason is exactly the signal the model needs to revise its plan and stop repeating the same call. When it is scrubbed before re-prompting, the agent re-attempts the failed action turn after turn, sometimes in tight loops, because nothing in its visible context contradicts the choice. After-the-fact debugging is also harder, because the transcript no longer shows whether a run succeeded cleanly or was salvaged across several hidden failures.
Solution
Don't. Treat failure observations as load-bearing context, not noise. Preserve stack traces, tool-error returns, and rejection messages in the agent's running transcript. Compress only after the run is done, not mid-loop. See decision-log and provenance-ledger for keeping the audit trail separate from the working context.
When to use
- Cite this entry when a trace-cleanup step removes failed actions so runs look tidy.
- You are already here if the model repeats an action that just failed because the failure left no evidence in context.
- Keep failure observations in the running transcript and compress only at run boundaries (see decision-log, provenance-ledger).
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.