Bug
parseLaunchctlPrint() in src/daemon/launchd.ts:131 only checks Number.isFinite(pid) before storing the PID, but the equivalent systemd parser at src/daemon/systemd.ts:122 correctly checks Number.isFinite(pid) && pid > 0.
When launchctl print reports pid = 0 (meaning no running process), the launchd parser stores pid: 0 in the result, which is semantically incorrect — PID 0 is the kernel scheduler, never a user-space service.
Inconsistency
// systemd.ts:122 — correct
if (Number.isFinite(pid) && pid > 0) {
info.mainPid = pid;
}
// launchd.ts:131 — missing pid > 0
if (Number.isFinite(pid)) {
info.pid = pid;
}
Expected behavior
parseLaunchctlPrint should reject pid <= 0 the same way parseSystemdShowOutput does.
Impact
Low — the downstream readLaunchAgentRuntime at line 191 accidentally handles this because parsed.pid (0) is falsy in the ternary. But exposing pid: 0 to callers is semantically wrong and fragile.
Bug
parseLaunchctlPrint()insrc/daemon/launchd.ts:131only checksNumber.isFinite(pid)before storing the PID, but the equivalent systemd parser atsrc/daemon/systemd.ts:122correctly checksNumber.isFinite(pid) && pid > 0.When
launchctl printreportspid = 0(meaning no running process), the launchd parser storespid: 0in the result, which is semantically incorrect — PID 0 is the kernel scheduler, never a user-space service.Inconsistency
Expected behavior
parseLaunchctlPrintshould rejectpid <= 0the same wayparseSystemdShowOutputdoes.Impact
Low — the downstream
readLaunchAgentRuntimeat line 191 accidentally handles this becauseparsed.pid(0) is falsy in the ternary. But exposingpid: 0to callers is semantically wrong and fragile.