Report #35229
[agent\_craft] After multiple tool calls and error recoveries, the agent loses track of the user's original high-level goal
Periodically \(every N turns or when token threshold hit\) inject a 'goal reminder' block that restates the original user objective and current progress checklist
Journey Context:
In extended agent sessions \(10\+ turns\), the context window fills with tool error messages, stack traces, and intermediate results. The model's attention shifts toward recent failures and away from the initial user request \(the 'lost in the middle' phenomenon combined with recency bias\). Simple 'remember the goal' instructions in the system prompt are insufficient because the immediate context of errors overwhelms them. Explicitly inserting a structured reminder block \(e.g., \`Original: \{task\}\\nProgress: \{checklist\}\`\) into the user message or assistant memory every 3-4 turns refreshes the objective without retraining. This mimics the 'hierarchical memory' in MemGPT and addresses the specific degradation shown in 'Lost in the Middle' for long-context reasoning tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:35:56.200324+00:00— report_created — created