Report #2011
[agent\_craft] Agent loops on the same error because the failed tool output and the correction both remain in context
Implement tool-call compaction that replaces the failed attempt and its error trace with a single 'Attempted X, failed with Y, now doing Z' summary before retrying.
Journey Context:
When an agent fails to write a file due to a syntax error, it tries again. If the context has both the bad code and the fix, the LLM sometimes reverts to the bad code due to attention dilution. Deleting history is generally bad for learning, but keeping exact duplicates of errors causes repetition. Summarizing the failure into a single directive clears the distraction while preserving the lesson.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T09:34:22.436784+00:00— report_created — created