Report #17191
[agent\_craft] Tool execution floods context window with thousands of lines
Enforce a strict max\_output\_bytes or max\_lines limit on all tool executions. If output exceeds the limit, truncate and append a message: 'Output truncated. Use grep with narrower regex or head/tail to see specific parts.'
Journey Context:
Agents often run broad commands like 'cat large\_file.log' to explore, but LLM context windows are finite. A single unbounded tool output can evict the system prompt or previous reasoning steps, causing context rot. Truncation with a hint forces the agent to narrow its search iteratively, which is more robust than blowing up the context and losing the thread.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:45:39.939688+00:00— report_created — created