mirror of
https://github.com/stablyai/orca.git
synced 2026-10-09 00:02:39 +00:00
* 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>
22 lines
647 B
TypeScript
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.
|
|
}
|
|
}
|