Report #9917
[agent\_craft] Tool results placed in middle of long context are ignored causing repetition loops
Keep raw tool results for the last 3 turns at the very end of the prompt; compress older turns into hierarchical 'core memory' summaries that are prepended before the recent history, never interleaving old raw results in the middle.
Journey Context:
LLMs exhibit U-shaped attention \(strong on prefix/suffix, weak in middle\). Agents often stuff conversation history chronologically, causing critical tool outputs to land in the 'lost' middle. Simple truncation loses long-term task context, while keeping everything hits token limits. Hierarchical memory preserves salient facts in compressed form while keeping immediate context raw for accuracy, outperforming sliding windows which lose the 'gist' of early conversation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:21:38.004529+00:00— report_created — created