Report #49610
[agent\_craft] Agent loses original task intent after multiple tool calls fill the context window with results
Implement proactive compaction: after every N tool calls or when tool output exceeds ~25% of context, summarize accumulated findings into a structured format. Always re-inject the original task/goal statement at the top after compaction. Treat the task prompt as immutable and tool outputs as disposable.
Journey Context:
The common failure mode is letting tool call results accumulate until hitting the context limit, then attempting a single massive summarization. By that point, the original task requirements have been pushed so far from the generation point that the model has effectively forgotten them. A cat of a large file can consume 10K\+ tokens of near-zero-value content. The MemGPT architecture solved this by treating context like virtual memory: there is a working context \(active page\) and archival storage \(disk/database\). When working context fills, the least recently used content is evicted to archival and a summary is kept. The critical insight is that compaction must be PROACTIVE \(triggered by thresholds\) not REACTIVE \(triggered by hitting limits\), and the original task/goal must be treated as a pinned page that never gets compacted.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:45:18.040129+00:00— report_created — created