(reason: string)
| 287 | }; |
| 288 | |
| 289 | const installSupervisedAndWait = async (reason: string): Promise<SidecarConnection | null> => { |
| 290 | const settings = getServerSettings(); |
| 291 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: install failure falls back to managed-spawn so the app still launches |
| 292 | try { |
| 293 | await installSupervisedService({ |
| 294 | port: settings.port, |
| 295 | dataDir: DESKTOP_DATA_DIR, |
| 296 | }); |
| 297 | } catch (error) { |
| 298 | log.warn(`Failed to install supervised service after ${reason}; using managed sidecar`, error); |
| 299 | return null; |
| 300 | } |
| 301 | return waitForSupervisedAttach(15_000, { port: settings.port }); |
| 302 | }; |
| 303 | |
| 304 | /** |
| 305 | * Resolve a connection to the OS-supervised daemon, installing it on first run |
no test coverage detected