Report #63700
[agent\_craft] Agent loops and retries failing tool calls, filling the context with identical error messages
Implement a deduplication or compaction step that detects repeated consecutive tool-call/error pairs and replaces them with a summary like '\[Attempted X 3 times, failed with Error Y\]'.
Journey Context:
When an agent gets stuck in a loop \(e.g., failing to install a package\), it will happily append the same 500-line traceback to the context 5 times. This burns context budget and reinforces the loop. Collapsing these loops breaks the token-attention feedback loop of the error, forcing the agent to try a different strategy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:24:31.401627+00:00— report_created — created