Files
orca/src/relay/subprocess-tree-termination.ts
T
OrcaWinandBrennan Benson e109e78ebf fix(source-control): keep huge change sets responsive (#9477)
* fix(source-control): keep huge change sets responsive

* Fix cancellation and retry handling for capped status

* Harden capped status for conflict-heavy repositories

* Harden capped status recovery and cancellation

* fix(source-control): preserve capped status correctness

* fix(source-control): translate submodule status at render time

---------

Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
2026-07-20 14:50:12 -07:00

22 lines
647 B
TypeScript

import { execFile, type ChildProcess } from 'node:child_process'
// Why: Windows commands may run through wrappers, so killing only the direct
// child can leave Git or an agent alive after cancellation.
export function terminateRelaySubprocessTree(child: ChildProcess): void {
const pid = child.pid
if (!pid) {
return
}
if (process.platform === 'win32') {
execFile('taskkill', ['/pid', String(pid), '/T', '/F'], () => {
// Best-effort; the child close listener owns completion.
})
return
}
try {
child.kill('SIGKILL')
} catch {
// Child may already have exited between the kill request and now.
}
}