Report #14089
[agent\_craft] Agent gets confused or loops when tool outputs \(like logs\) are too large and push system instructions out of context
Truncate or summarize tool outputs before inserting them back into the context window. Never dump unbounded stdout into the message history.
Journey Context:
A common failure mode is running a command that returns 10,000 lines of logs. This fills the context, pushes out the original plan, and the agent forgets what it was doing. Tool outputs must be bounded. If the output exceeds a threshold \(e.g., 2000 tokens\), truncate it with a message like '\[Output truncated. Use grep or tail to see more\]'. This keeps the agent focused and preserves the system prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T20:40:14.855332+00:00— report_created — created