Files
orca/src/cli/runtime/runtime-pid-liveness.ts
T
Brennan Benson a856bc8af2 fix(cli): preserve runtime access across Linux PID namespaces (#35769)
* fix(cli): preserve runtime access across Linux PID namespaces

* fix(cli): give retry advice after runtime replacement

* fix(cli): preserve private offline admission policy

* test(cli): align admission and launcher contracts

* test(cli): prune resolved wall-clock allowance

* test(cli): narrow dropped runtime errors without casts

* test(cli): use explicit extension for hook service import

* test(cli): replay recorded Linux sandbox denial

* test: verify packaged Linux desktop CLI ownership

* test: handle denied FUSE mounts in desktop fixture

* test: use privileged PID namespace in desktop fixture
2026-10-29 22:55:19 -07:00

13 lines
375 B
TypeScript

// Only the private offline compatibility policy uses this unqualified legacy PID observation.
export function isProcessRunning(pid: number | null | undefined): boolean {
if (!pid || pid <= 0) {
return false
}
try {
process.kill(pid, 0)
return true
} catch (error) {
return !(error instanceof Error && 'code' in error && error.code === 'ESRCH')
}
}