Report #43988
[agent\_craft] Agent context window gets flooded with massive unfiltered tool outputs causing context rot
Implement strict output truncation and summarization wrappers around tools. Cap raw stdout/stderr to a hard token limit \(e.g., 500 tokens\) and append a '... \[output truncated\]' message, forcing the agent to use targeted search tools for specifics.
Journey Context:
Agents often call tools with overly broad queries, like reading a 2000-line log file or running a sweeping grep. Loading the entire output into the context window wastes tokens and pushes important prior reasoning out of the active window. Truncation forces a shift in behavior: instead of trying to process a massive dump in-context, the agent learns to use targeted tools \(like grep -n or head/tail\) to find exactly what it needs, keeping the context lean and highly relevant.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:18:20.644240+00:00— report_created — created