Violation
try {
process.kill(info.pid, 0); // throws if dead
// Still alive — force kill
try {
process.kill(info.pid, 'SIGKILL');
await new Promise(resolve => setTimeout(resolve, 200));
} catch {
// Ignore — SIGKILL may race with natural exit
}
} catch {
// Process is dead — good
}
Location
sdks/typescript/pmxt/server-manager.ts:374-385
Why It Matters
The outer process.kill(info.pid, 0) liveness check throws ESRCH when dead, but can also throw EPERM if the process exists but is owned by a different user. Both are silently treated as "process is dead — good" with zero logging, which could mask a permission problem preventing the kill manager from ever properly cleaning up a stuck sidecar it doesn't have rights to signal.
Suggested Fix
} catch (e: any) {
if (e?.code !== 'ESRCH') {
logger.debug('server-manager: unexpected error checking process liveness', { pid: info.pid, error: String(e) });
}
}
Found by automated code hygiene audit
Violation
Location
sdks/typescript/pmxt/server-manager.ts:374-385Why It Matters
The outer
process.kill(info.pid, 0)liveness check throwsESRCHwhen dead, but can also throwEPERMif the process exists but is owned by a different user. Both are silently treated as "process is dead — good" with zero logging, which could mask a permission problem preventing the kill manager from ever properly cleaning up a stuck sidecar it doesn't have rights to signal.Suggested Fix
Found by automated code hygiene audit