Report #74621
[architecture] Agent losing track of the current task when context window fills up
Implement a rolling summary mechanism for short-term memory. When the context window reaches a threshold, summarize the oldest third of the conversation or scratchpad, replace it with the summary token, and persist the raw text to long-term storage.
Journey Context:
Simply dropping the oldest messages via FIFO destroys crucial early context like the system prompt or initial goal. Simply expanding the context window increases latency and cost, and degrades instruction-following. Rolling summarization preserves the high-level intent and progress while freeing up token space for immediate reasoning. The tradeoff is the loss of granular detail from the summarized turns, which is why persisting the raw logs to a searchable long-term store is critical.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:50:58.424268+00:00— report_created — created