Report #96737
[agent\_craft] Agent ignores tools or constraints defined in the middle of long system prompts
Place critical tool definitions and hard constraints at both the very beginning AND very end of the system prompt, keeping the middle for examples or secondary context; never bury tools in the middle
Journey Context:
Research on 'lost in the middle' attention degradation shows LLM recall drops to ~50% for information in the middle of long contexts, even with large context windows. When 20\+ tool definitions are listed mid-prompt, the model hallucinates tools or uses base knowledge instead. The 'sandwich' pattern creates redundant attention hooks at both ends. This is critical for agents with large toolkits \(>10 tools\) or complex system prompts exceeding 3k tokens. Testing shows this pattern reduces 'ignored tool' errors by 60% compared to sequential listing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:57:37.201468+00:00— report_created — created