Problem
We’re seeing agent runs terminate with a summarization result such as:
There's no prior conversation content in this thread to summarize.
even though the thread contains substantial conversation history and multiple tool calls.
Example
The agent was analyzing a large minified file:
read_file(Resources/Raw/wwwroot/sf-richtexteditor.js)
The tool returned a very large response (hundreds of KB).
Later, when context compaction/summarization was triggered, the summarizer produced:
There's no prior conversation content in this thread to summarize.
This summary was then surfaced as the assistant response, and the task never completed.
Investigation
While reviewing the DeepAgents summarization logic, it appears the summarizer trims the messages being summarized to trimTokensToSummarize (default ~4000 tokens).
The logic is roughly:
let kept = 0;
const trimmed = \[\];
for (let i = messages.length - 1; i >= 0; i--) {
const t = countTokensApproximately(\[messages\[i\]\]);
if (kept + t > trimTokensToSummarize) {
break;
}
trimmed.unshift(messages\[i\]);
kept += t;
}
messagesToSummarize = trimmed;
If the newest message in the summarization slice is a large tool result:
Tool Result: 50,000+ tokens
trimTokensToSummarize: 4,000
the loop exits immediately:
messagesToSummarize = \[\]
which leads to:
conversation = ""
The summarizer effectively receives:
Conversation to summarize:
Summary:
and generates a “no content” response.
Additional Observation
In our run, the task was not actually finished.
The agent still had remaining work to do, but after summarization the thread ended with the summary message as the final assistant response.
The original task never completed.
Questions
- Is this the same issue as GitHub issue #6470 and #5913 (“Summary input limit can produce a content-free compaction”) or is this a separate edge case?
- Is there any protection against a single tool-result message completely emptying
messagesToSummarize? - Should summarization fall back to truncating the oversized message instead of returning an empty summary?
- Is it expected that a summarizer response can become the final assistant message while there is still unfinished work in the run?
- Are there recommended settings for handling large
read_file/grepresults from minified files?