Gracefully terminate running subprocess if user cancels task in the middle of a command

This commit is contained in:
Saoud Rizwan
2024-08-10 03:41:47 -04:00
parent c1012dcd99
commit 9f7d6d428b
2 changed files with 15 additions and 7 deletions

View File

@@ -332,12 +332,8 @@ export class ClaudeDevProvider implements vscode.WebviewViewProvider {
}
async clearTask() {
if (this.claudeDev) {
this.claudeDev.abort = true // will stop any agentically running promises
this.claudeDev = undefined // removes reference to it, so once promises end it will be garbage collected
}
// this.setApiConversationHistory(undefined)
// this.setClaudeMessages(undefined)
this.claudeDev?.abortTask()
this.claudeDev = undefined // removes reference to it, so once promises end it will be garbage collected
}
// Caching mechanism to keep track of webview messages + API conversation history per provider instance