|
|
@@ -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
|