Report #83481
[agent\_craft] Agent loses track of earlier tool results in long conversations because context window fills with redundant status messages
Implement hierarchical context pruning: keep all system messages and the last 3 user-assistant exchanges in full; compress older tool results into 'memory packets' containing only the final returned value and a one-sentence summary of the tool name and success/failure; drop intermediate reasoning traces.
Journey Context:
In multi-turn agent loops, the context grows linearly with each tool call. Standard 'keep last N messages' truncation cuts off the initial system prompt or early user intent. The solution is asymmetric compression: recent turns stay verbose \(full XML tool results\), old turns get summarized into structured memory. Crucially, tool error messages should be summarized but not discarded entirely, as they inform the agent not to retry the same path. This pattern comes from analyzing token distributions in ReAct-style loops where 60% of tokens were repetitive XML tags from old tool calls.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:42:31.561553+00:00— report_created — created