Handle cancelling during hanging stream

This commit is contained in:
Saoud Rizwan
2024-10-17 08:29:43 -04:00
parent 364f0921ba
commit 70d30e9f2b
2 changed files with 22 additions and 8 deletions

View File

@@ -446,6 +446,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
}).catch(() => {
console.error("Failed to abort task")
})
if (this.cline) {
// 'abandoned' will prevent this cline instance from affecting future cline instance gui. this may happen if its hanging on a streaming request
this.cline.abandoned = true
}
await this.initClineWithHistoryItem(historyItem) // clears task again, so we need to abortTask manually above
// await this.postStateToWebview() // new Cline instance will post state when it's ready. having this here sent an empty messages array to webview leading to virtuoso having to reload the entire list
}