(reason: string)
| 247 | }; |
| 248 | |
| 249 | const installSupervisedAndWait = async (reason: string): Promise<SidecarConnection | null> => { |
| 250 | const settings = getServerSettings(); |
| 251 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: install failure falls back to managed-spawn so the app still launches |
| 252 | try { |
| 253 | await installSupervisedService({ |
| 254 | port: settings.port, |
| 255 | dataDir: DESKTOP_DATA_DIR, |
| 256 | }); |
| 257 | } catch (error) { |
| 258 | log.warn(`Failed to install supervised service after ${reason}; using managed sidecar`, error); |
| 259 | return null; |
| 260 | } |
| 261 | return waitForSupervisedAttach(15_000, { port: settings.port }); |
| 262 | }; |
| 263 | |
| 264 | /** |
| 265 | * Resolve a connection to the OS-supervised daemon, installing it on first run |
no test coverage detected