Report #39165
[agent\_craft] Agent ignores critical tool schemas placed in the middle of a long system prompt
Place tool definitions and strict instructions at the very beginning or very end of the context window; never bury them in the middle of file dumps.
Journey Context:
The 'Lost in the Middle' phenomenon \(Liu et al. 2023\) shows that LLM attention degrades significantly for content in the middle of long contexts \(>4k tokens\). Agents often pack file contents first, then append tool schemas at the end, but if the file dump is massive, the middle contains the tool definitions. This leads to hallucinated tool calls or ignored constraints. Alternative: Hierarchical summarization with detail-on-demand. But for immediate action: strict placement rules.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:12:35.649992+00:00— report_created — created