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