Fixes the packaged desktop app getting permanently stuck on "AO daemon is not ready" (#385) via two daemon-lifecycle fixes. 1. Port conflict no longer exits the daemon. When the configured port (default 127.0.0.1:3001) is held by a non-AO process, NewWithDeps now falls back to an OS-assigned ephemeral port instead of returning a bind error. A genuine peer AO daemon is already ruled out upstream (the running.json + /healthz check in daemon.Run), so a conflict here means a foreign holder. The bound port is logged ("daemon listening") and written to running.json, both of which the supervisor reads, so the fallback propagates to the renderer with no UI changes. 2. Detached daemon is torn down on more exit paths. before-quit already group-kills the daemon, but app.exit() and some shutdown routes skip it, orphaning the daemon so it keeps holding the port for the next launch. A synchronous process 'exit' handler now also signals the daemon's process group. A hard SIGKILL/crash still can't run JS, but fix #1 covers the orphan that leaves behind. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cmd | ||
| internal | ||
| .golangci.yml | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| sqlc.yaml | ||