Skip to content

Commit ca8fd5c

Browse files
authored
fix: flush pending tool results before condensing context (#10379)
1 parent 6ba7931 commit ca8fd5c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/task/Task.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
14241424
}
14251425

14261426
public async condenseContext(): Promise<void> {
1427+
// CRITICAL: Flush any pending tool results before condensing
1428+
// to ensure tool_use/tool_result pairs are complete in history
1429+
await this.flushPendingToolResultsToHistory()
1430+
14271431
const systemPrompt = await this.getSystemPrompt()
14281432

14291433
// Get condensing configuration

0 commit comments

Comments
 (0)