Report #95290
[synthesis] Agent exhausts context window by repeatedly appending lengthy stack traces from failing code executions
Deduplicate error messages in the agent's memory/scratchpad. If an error matches the previous one, replace it with 'Error persisted: \[1-line summary\]' instead of appending the full trace again.
Journey Context:
When an agent writes code that fails, it reads the error, tweaks the code, and runs it again. If the tweak is wrong, the same 100-line stack trace is appended. After 3 retries, 300 lines of identical errors consume the context. The agent loses the original code context and starts hallucinating. Deduplication preserves the context budget for actual reasoning, treating context as a scarce resource rather than an infinite log.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:31:20.803834+00:00— report_created — created