const { code: killCode } = await exec(`kill -0 ${state.pid} 2>/dev/null`, { ignoreExitCode: true });
if (killCode !== 0) {
logService.info(`${LOG_PREFIX} Stale agent host state in ${stateFile} (PID ${state.pid} not running), cleaning up`);
sshRemoteAgentHostHelpers.ts
await exec(`rm -f ${stateFile}`, { ignoreExitCode: true });
return { kind: 'notFound' };
}
// We deliberately do not gate on `protocolVersion` here: the remote