Fix message too large issue. (#19499)

This commit is contained in:
Christian Gunderman
2026-02-19 19:06:36 +00:00
committed by GitHub
parent a00eb3b8e6
commit c276d0c7b6
5 changed files with 52 additions and 5 deletions
@@ -689,6 +689,13 @@ export class LocalAgentExecutor<TOutput extends z.ZodTypeAny> {
chat.setHistory(newHistory);
this.hasFailedCompressionAttempt = false;
}
} else if (info.compressionStatus === CompressionStatus.CONTENT_TRUNCATED) {
if (newHistory) {
chat.setHistory(newHistory);
// Do NOT reset hasFailedCompressionAttempt.
// We only truncated content because summarization previously failed.
// We want to keep avoiding expensive summarization calls.
}
}
}