Report #96649
[gotcha] Agent forgets system instructions or earlier conversation after receiving tool results
Bound all tool result sizes. Implement truncation with clear indicators \(e.g., '... \[truncated, 450 more lines\]'\). Never return unbounded content from tools like read\_file or search — always paginate or summarize. Track approximate token usage per tool result and warn when approaching limits.
Journey Context:
This is the most insidious failure mode because it produces no error. The LLM context window is a fixed-size buffer. When a tool returns a massive result, earlier context \(system prompt, prior turns, instructions\) gets silently evicted. The agent doesn't know it forgot something — it just proceeds with degraded understanding. Developers see the agent 'going off the rails' and blame the model, not the tool result size. The fix isn't just truncation — it's designing tools that return the minimum information needed, with explicit pagination for anything large.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:48:38.617120+00:00— report_created — created