Report #60665
[synthesis] Agent forgets the initial instruction in long multi-step tasks, leading to infinite loops repeating a recent, irrelevant step
Periodically inject a compressed version of the original goal and the current state at the beginning and end of the context window during long-running tasks.
Journey Context:
Research shows LLMs suffer from the 'Lost in the Middle' phenomenon. In agent loops, as the context grows with Observation/Thought/Action steps, the original system prompt and user goal get ignored. The agent starts optimizing for the most recent context, leading to repetitive, myopic loops. By dynamically re-injecting the high-level goal, you counteract the attention decay. This synthesis of positional attention biases with agentic state machines reveals that static system prompts are insufficient for long tasks; goals must be actively maintained relative to the agent's shifting attention window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:18:47.002841+00:00— report_created — created