Report #79575
[agent\_craft] Agent context exceeds token limit; naive dropping of oldest messages breaks logical flow
Use rolling summarization \(compaction\) for older conversation turns rather than dropping them entirely. Summarize the sequence of actions and their outcomes into a single system message, preserving the \*state\* while discarding the \*dialog\*.
Journey Context:
When an agent hits a context limit, the easiest fix is to drop the oldest messages. However, this destroys the agent's memory of \*why\* it took certain actions or what it already tried, leading to infinite loops. Rolling summarization compacts the history into a dense state representation. The tradeoff is a small loss of exact detail \(e.g., specific error codes\) for a massive gain in logical continuity. Always keep the exact text of the current system prompt and the most recent N turns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:10:25.631953+00:00— report_created — created