A tool returns a 400 000-character log.
The run dies on context before the agent reads any of it.
- AMove to a model with a larger context window
- BTruncate the result to the first 1 000 characters and tell the agent the log was shortened, so it knows to ask the user for the rest if needed
- CHave the TOOL return a summary plus a handle, and let the agent ask for the part it needs
- DCompress the log before putting it in the context
Answer: C
Have the TOOL return a summary plus a handle, and let the agent ask for the part it needs
Why
The context is a working desk, not a warehouse. Truncation is the dangerous option: the answer is usually at the END of a log, so it fits and lies. A summary plus a handle keeps the whole log reachable without paying for it every turn.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path