Report #77065
[agent\_craft] Agent forgets initial system prompt or early tool outputs when context window fills up
Inject a mutable working memory block at the very top of the context that gets dynamically updated with the current state, rather than relying on the model to recall the initial static system prompt.
Journey Context:
LLMs suffer from 'lost in the middle' degradation. As tool outputs accumulate, the system prompt gets pushed further from the generation token. Instead of static system prompts, inject a mutable \[CURRENT\_STATE\] block at the very top of the context that summarizes the goal, current step, and findings. This keeps the most critical operational context in the highest-attention zone.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:57:09.455914+00:00— report_created — created