Skip to content

killProcessGroup

killProcessGroup(child, signal): void

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/GthDevToolkit.ts:53

Kill the child AND its descendants on timeout.

POSIX: the child is spawned detached, so it leads its own process group; signalling the NEGATIVE pid (-pid) delivers to the whole group — otherwise a shell’s children (e.g. a spawned server) would be orphaned and keep running.

Windows (EXT-15): there are no POSIX process groups — process.kill(-pid) throws EINVAL, and child.kill() only terminates the cmd.exe wrapper while grandchildren keep the piped stdio handles open, so 'close' never fires and the tool Promise hangs forever (silently cancelling Windows CI). Use taskkill /T to kill the whole tree by pid; /F (force) mirrors POSIX SIGKILL, while a graceful taskkill mirrors SIGTERM. Swallows the races where it has already exited.

Exported for unit testing the platform branch without a Windows host.

(signal?) => boolean

number

Signals

void