agent-orchestrator/backend/internal/daemon
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
..
supervisor fix(dev): isolate dev daemon from installed app on port and state dir (#2465) 2026-07-08 22:34:21 +05:30
cdc_wiring.go refactor: simplify session lifecycle and zellij runtime (#62) 2026-06-01 08:42:49 +05:30
daemon.go feat(cli): context-aware agent spawn with agent catalog and auth preflight (#2411) 2026-07-04 21:23:03 +05:30
lifecycle_wiring.go feat(tracker): GitHub issue intake (backend + dashboard) (#2325) 2026-07-04 02:52:14 +05:30
scm_wiring.go feat: ao session claim-pr + spawn --claim-pr wiring (#101) 2026-06-06 00:01:03 +05:30
stale.go feat(windows): ConPTY terminal, zellij discovery, agent launcher trampoline, codex shim resolution (#310) 2026-06-18 21:51:05 +05:30
stale_test.go feat(windows): ConPTY terminal, zellij discovery, agent launcher trampoline, codex shim resolution (#310) 2026-06-18 21:51:05 +05:30
telemetry_wiring.go Feat/backend telemetry v0 (#307) 2026-06-18 22:00:25 +05:30
telemetry_wiring_test.go Feat/backend telemetry v0 (#307) 2026-06-18 22:00:25 +05:30
tracker_intake_wiring.go feat(tracker): GitHub issue intake (backend + dashboard) (#2325) 2026-07-04 02:52:14 +05:30
wiring_test.go feat(tracker): GitHub issue intake (backend + dashboard) (#2325) 2026-07-04 02:52:14 +05:30