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