Commit cf8dd99
committed
fix(desktop): harden lifecycle robustness — external runner, evidence-based updates, unified teardown
- Extract Electron binary + frameworks to ~/.nexu/runtime/nexu-runner.app/ via
APFS clone so launchd services never reference the .app bundle, unblocking
Finder drag-and-drop reinstalls
- Extract controller sidecar to ~/.nexu/runtime/controller-sidecar/ for the
same reason; openclaw sidecar already extracted by existing logic
- All three extractions use staging dir + atomic rename to prevent half-copies
- Version-aware attach: refuse to attach to services from a different app
version, build source, userDataPath, or openclawStateDir
- Evidence-based update install: after process sweeps, lsof-check critical
paths; only abort if .app bundle or sidecar dirs are actually locked
- Unified dev/packaged teardown: Cmd+Q, window close, and no-window exit
all go through teardownLaunchdServices in both modes
- daemon-supervisor circuit breaker: MAX_CONSECUTIVE_RESTARTS=10 with
120s window, emits max_restarts_exceeded reason code
- bootoutService tolerates "already gone" errors
- runtime-ports.json atomic write (tmp + rename)
- Tighter orphan cleanup: prefer launchd label + runtime-ports metadata,
fall back to pgrep with node.* prefix and process tree exclusion1 parent b792fc9 commit cf8dd99
File tree
19 files changed
+1593
-176
lines changed- apps/desktop
- main
- runtime
- services
- updater
- tests/desktop
19 files changed
+1593
-176
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
550 | 554 | | |
551 | 555 | | |
552 | 556 | | |
| |||
620 | 624 | | |
621 | 625 | | |
622 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
623 | 632 | | |
624 | 633 | | |
625 | 634 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
362 | 367 | | |
363 | 368 | | |
364 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
365 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
366 | 394 | | |
367 | 395 | | |
368 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
193 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
194 | 202 | | |
195 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
196 | 225 | | |
197 | 226 | | |
198 | 227 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 228 | + | |
202 | 229 | | |
203 | 230 | | |
204 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments