Report #6802
[architecture] Agent loses early instructions when conversation history exceeds the context window limit
Do not use a naive sliding window that chops off the oldest messages. Keep the system prompt and first few user messages permanently pinned, and use a background LLM call to continuously summarize the middle of the conversation history into a running scratchpad memory.
Journey Context:
Sliding windows drop the initial task definition, causing the agent to drift. Full re-summarization of the whole context is expensive and loses recent detail. Pinning the start \(task\) and end \(recent actions\) while compressing the middle preserves the agent's objective while keeping token usage bounded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:08:02.666416+00:00— report_created — created