fix: flush pending tool results before condensing context (#10379)

This commit is contained in:
Daniel 2025-12-29 18:43:02 -05:00 committed by GitHub
parent 6ba793137d
commit ca8fd5c867
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1424,6 +1424,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
}
public async condenseContext(): Promise<void> {
// CRITICAL: Flush any pending tool results before condensing
// to ensure tool_use/tool_result pairs are complete in history
await this.flushPendingToolResultsToHistory()
const systemPrompt = await this.getSystemPrompt()
// Get condensing configuration