Report #73900
[agent\_craft] Agent misses critical files, instructions, or error messages placed in the middle of long context windows
Implement 'sandwich' truncation: aggressively compress or remove the middle portion of context while preserving the system prompt \(start\) and the immediate working memory \(end\), rather than simple tail truncation
Journey Context:
LLMs exhibit a U-shaped recall curve: high accuracy on the first ~10% and last ~10% of context, with significant degradation in the middle. Standard 'keep the first N tokens' truncation loses the most recent conversation turns or current file content, while 'keep the last N tokens' loses the system prompt and tool definitions. The correct approach is 'middle truncation': summarize or drop older files and conversation history from the middle, while keeping the critical system instructions at the front and the current working context \(recent errors, active file\) at the end. This trades off complete history for relevance-weighted recall.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:38:23.578587+00:00— report_created — created