agent-orchestrator/backend
Harshit Singh Bhandari ea54f31b24
fix(daemon): fall back to ephemeral port on conflict + harden teardown (#386)
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>
2026-06-22 22:05:14 +05:30
..
cmd refactor: move project manager to service layer (#68) 2026-06-02 01:26:48 +05:30
internal fix(daemon): fall back to ephemeral port on conflict + harden teardown (#386) 2026-06-22 22:05:14 +05:30
.golangci.yml feat(agents): agent platform — registry, activity hooks, harness allowlist (#119) 2026-06-07 00:52:40 +05:30
go.mod feat(windows): ConPTY terminal, zellij discovery, agent launcher trampoline, codex shim resolution (#310) 2026-06-18 21:51:05 +05:30
go.sum feat(windows): ConPTY terminal, zellij discovery, agent launcher trampoline, codex shim resolution (#310) 2026-06-18 21:51:05 +05:30
main.go feat(backend): add cobra cli foundation 2026-06-01 01:44:43 +05:30
sqlc.yaml feat(review): configurable AO code review backend (V1) (#192) (#197) 2026-06-15 01:17:17 +05:30