From b00bf19c867a7aa2c1af8ada4a02cf2be93ffe3e Mon Sep 17 00:00:00 2001 From: Roo Code Date: Mon, 15 Dec 2025 15:16:28 +0000 Subject: [PATCH] fix: await abortTask in cancelTask to prevent content loss When canceling a task during an API request, messages were being lost because abortTask() was called without await. This caused the history to be fetched before messages were saved to disk. The fix adds await to the abortTask() call to ensure messages are properly persisted before createTaskWithHistoryItem() attempts to read them. Fixes #10093 --- src/core/webview/ClineProvider.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 715a830fb69..485723d3309 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -2730,8 +2730,9 @@ export class ClineProvider // This ensures the stream fails quickly rather than waiting for network timeout task.cancelCurrentRequest() - // Begin abort (non-blocking) - task.abortTask() + // Begin abort and wait for messages to be saved to disk + // This ensures history is properly persisted before rehydration + await task.abortTask() // Immediately mark the original instance as abandoned to prevent any residual activity task.abandoned = true