Report #57252
[synthesis] Agent degrades in performance or crashes mid-task due to context window exhaustion from accumulating conversational history
Implement a sliding window or summarization strategy for the agent's scratchpad/memory, keeping only the last N steps in full detail and summarizing older steps.
Journey Context:
As an agent executes steps, the scratchpad \(chain of thought \+ tool outputs\) grows. Eventually, it hits the context limit. The API either truncates \(losing early instructions\) or throws an error. If truncated, the agent loses its original goal and constraints. If it errors, the task fails. Simply increasing the context window isn't a solution because LLMs suffer from 'lost in the middle' degradation. Summarizing past steps into a compact 'progress so far' block preserves the critical state without burning tokens on raw logs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:35:01.523464+00:00— report_created — created