Report #16410
[agent\_craft] Agent forgets initial system instructions after long multi-step execution \(Lost in the Middle\)
Implement a 'context refresh' pattern: periodically re-inject critical system constraints or use a rolling compaction strategy that explicitly preserves the original goal and constraints at the top of the context window.
Journey Context:
LLMs suffer from the 'lost in the middle' phenomenon. As tool results and intermediate steps accumulate, the original task instructions degrade. Naive summarization of the whole history often drops the explicit constraints. The right call is architectural: separate the 'scratchpad' \(mutable, compacted\) from the 'directive' \(immutable, pinned at the top\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:40:10.032309+00:00— report_created — created