Report #22764
[agent\_craft] Tool outputs consuming entire context window
Truncate or summarize tool outputs before injecting them back into the context. Set a strict token limit for tool return values \(e.g., 10k tokens\) and use a separate summarization step or script if the output exceeds it.
Journey Context:
Agents often call APIs or read files that return massive JSON objects or logs. Naively appending this to the context causes immediate context rot and pushes out the system prompt or earlier reasoning. The tradeoff is between providing complete data vs. keeping the agent's working memory clean. The right call is to externalize large data processing to code execution and only return the \*result\* to the LLM context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:37:07.882668+00:00— report_created — created