357
return { kind: 'notFound' };
358
}
360
>
// We deliberately do not gate on `protocolVersion` here: the remote
361
>
// agent host server is downloaded on demand and may speak a newer
362
>
// protocol than this desktop was built with. The renderer↔AH
363
>
// handshake will surface a real incompatibility; for the SSH-side
364
>
// reuse decision we treat any live process as a candidate, and the
365
>
// caller (sshRemoteAgentHostService) already falls back to spawning
366
>
// fresh if the relay fails to connect.
367
>
logService.info(`${LOG_PREFIX} Found running agent host via ${stateFile}: PID ${state.pid}, port ${state.port}`);
368
>
return {
369
>
kind: 'compatible',
370
>
host: dialAgentHostHost(state.host),
371
>
port: state.port,
372
>
connectionToken: state.connectionToken ?? undefined,
373
};
374
}