agent-orchestrator/backend/internal/daemon/supervisor
Pulkit Saraf f2da70d3bb
fix(dev): isolate dev daemon from installed app on port and state dir (#2465)
* fix(dev): isolate dev daemon from installed app on port and state dir

When running npm run dev while an installed AO app is already running,
both shared port 3001 and ~/.ao/running.json. The dev Electron would
attach to the installed daemon and tear it down on quit via the
supervisor link.

Fix: in dev mode (app.isPackaged === false), default to:
  - AO_PORT=3002          (separate port, no collision)
  - AO_RUN_FILE=~/.ao/dev/running.json  (isolates supervise.sock too,
    since the backend derives it as dir(RunFilePath)/supervise.sock)
  - AO_DATA_DIR=~/.ao/dev/data          (separate SQLite DB)

Explicit env var overrides still win, so contributors can further
customise via their shell environment. resolvedDaemonPort() encapsulates
the port lookup so all three probe call-sites stay consistent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(dev): isolate Windows supervisor pipe per run-file instance

On Windows the supervisor previously used a fixed global named pipe
(\\.\pipe\ao-supervise) on both the Go backend and Electron frontend,
so dev and installed-app daemons could still collide despite the
separate port and state dir. Both sides now derive the pipe name from
the run-file's parent directory, mirroring the Unix supervise.sock
placement: ~/.ao/dev/running.json → \\.\pipe\ao-supervise-dev.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 22:34:21 +05:30
..
listen_unix.go fix(daemon): stop orchestrator id-increment + OS-native daemon liveness link (#2185) 2026-06-26 18:28:32 +05:30
listen_unix_test.go fix(daemon): stop orchestrator id-increment + OS-native daemon liveness link (#2185) 2026-06-26 18:28:32 +05:30
listen_windows.go fix(dev): isolate dev daemon from installed app on port and state dir (#2465) 2026-07-08 22:34:21 +05:30
supervisor.go fix(daemon): stop orchestrator id-increment + OS-native daemon liveness link (#2185) 2026-06-26 18:28:32 +05:30
supervisor_test.go fix(daemon): stop orchestrator id-increment + OS-native daemon liveness link (#2185) 2026-06-26 18:28:32 +05:30