Fix task status reset issue - preserve running tasks on restart

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-22 14:42:44 +00:00
co-authored by whyour
parent d64dc64df7
commit f043aa62e4
2 changed files with 25 additions and 2 deletions
+10
View File
@@ -397,6 +397,16 @@ export function psTree(pid: number): Promise<number[]> {
});
}
export function isPidRunning(pid: number): boolean {
try {
// Signal 0 doesn't kill the process, just checks if it exists
process.kill(pid, 0);
return true;
} catch (error) {
return false;
}
}
export async function killTask(pid: number) {
const pids = await psTree(pid);