agent-orchestrator/backend/internal
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
..
adapters fix: add terminal controls and restore copy/scroll (#372) 2026-06-22 02:26:54 +05:30
agentlaunch feat(windows): ConPTY terminal, zellij discovery, agent launcher trampoline, codex shim resolution (#310) 2026-06-18 21:51:05 +05:30
cdc feat: ao session claim-pr + spawn --claim-pr wiring (#101) 2026-06-06 00:01:03 +05:30
cli fix(preview): add clear, reuse defaults, force refresh, local files (#379) (#380) 2026-06-22 16:04:29 +05:30
config feat: require explicit project agents (#355) 2026-06-21 06:07:53 +05:30
daemon Refactoring Reviews feature code and idempotency check (#377) 2026-06-22 15:40:00 +05:30
daemonmeta fix(cli): verify daemon ownership before stop signal 2026-06-01 01:45:04 +05:30
domain fix(preview): add clear, reuse defaults, force refresh, local files (#379) (#380) 2026-06-22 16:04:29 +05:30
httpd fix(daemon): fall back to ephemeral port on conflict + harden teardown (#386) 2026-06-22 22:05:14 +05:30
integration feat: require explicit project agents (#355) 2026-06-21 06:07:53 +05:30
legacyimport feat(import): rewrite-side legacy → rewrite first-boot import (#314) 2026-06-18 19:54:51 +05:30
lifecycle Refactoring Reviews feature code and idempotency check (#377) 2026-06-22 15:40:00 +05:30
notify feat: add notifications v1 (#181) 2026-06-14 20:02:32 +05:30
observe fix(session): make worker branch namespace child-safe (#309) 2026-06-18 20:00:15 +05:30
ports Feat/backend telemetry v0 (#307) 2026-06-18 22:00:25 +05:30
processalive refactor: simplify session lifecycle and zellij runtime (#62) 2026-06-01 08:42:49 +05:30
review Refactoring Reviews feature code and idempotency check (#377) 2026-06-22 15:40:00 +05:30
runfile refactor: simplify session lifecycle and zellij runtime (#62) 2026-06-01 08:42:49 +05:30
service Refactoring Reviews feature code and idempotency check (#377) 2026-06-22 15:40:00 +05:30
session_manager fix(session-manager): terminate sessions even when handle is missing (#360) 2026-06-21 14:30:00 +05:30
storage/sqlite fix(preview): add clear, reuse defaults, force refresh, local files (#379) (#380) 2026-06-22 16:04:29 +05:30
telemetrymeta Feat/posthog error tracking redaction (#329) 2026-06-21 18:50:47 +05:30
terminal fix: keep terminal mux persistent across navigation (#325) 2026-06-21 06:07:32 +05:30