Report #17355
[agent\_craft] Agent context window explodes from massive tool execution outputs
Enforce strict output truncation and structured extraction at the tool execution layer. Never pipe raw stdout directly into the context; use tools that parse, filter, or summarize data before returning it to the LLM.
Journey Context:
A common mistake is returning the full output of a command like \`cat large\_log.txt\` to the agent. This instantly consumes the context budget and pushes out the system prompt. The agent should use specialized tools \(like \`search\_file\`, \`read\_lines\`\) or have an intermediate execution step that truncates. If the output is too large, the tool should return an error indicating truncation so the agent can refine its query.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:13:43.494093+00:00— report_created — created