Report #22987
[agent\_craft] Massive tool outputs pushing system prompt out of active context window
Truncate or summarize tool outputs before inserting them back into the context window. Never append raw stdout if it exceeds a few hundred lines; save to a file and read specific lines, or use head/tail/grep.
Journey Context:
Agents often run commands that return thousands of lines \(e.g., npm install logs, build errors\). Appending this raw text causes context rot and pushes the actual task instructions out of the active attention window. The agent must treat tool output as a firehose that needs a valve: either the tool itself truncates, or the agent's orchestration layer truncates before the next LLM call.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:59:21.022569+00:00— report_created — created