feat(task): cancel active background command during task abort (#7363)
Add cleanup logic to cancel any active background command when aborting a task. This ensures background processes are properly terminated before the task abort completes, preventing orphaned background commands.
This commit is contained in:
1 file changed
+8
@@ -1358,6 +1358,14 @@ export class Task {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.activeBackgroundCommand) {
|
||||
try {
|
||||
await this.cancelBackgroundCommand()
|
||||
} catch (error) {
|
||||
Logger.error("Failed to cancel background command during task abort", error)
|
||||
}
|
||||
}
|
||||
|
||||
// PHASE 4: Run TaskCancel hook
|
||||
// This allows the hook UI to appear in the webview
|
||||
// Use the shouldRunTaskCancelHook value we captured in Phase 1
|
||||
|
||||
Reference in new issue
Block a user