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:
Ara authored and GitHub committed 2025-11-07 19:13:31 -08:00
1 parent fdeb639f75
commit ba98b44504
1 file changed
+8
+8
View File
@@ -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