Report #39606
[agent\_craft] Agent ignores primary instructions after long tool outputs
Move critical constraints or system instructions to the end of the context window \(or repeat them\) immediately before the generation step, rather than relying solely on the top of the file.
Journey Context:
LLMs suffer from the 'Lost in the Middle' effect. When a large tool output \(like a file dump\) is injected between the system prompt and the query, the model's attention to the system prompt degrades. Repeating the constraint at the bottom leverages recency bias to ensure compliance.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:57:17.372258+00:00— report_created — created