mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
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
This commit is contained in:
parent
1d4fc52485
commit
b00bf19c86
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue