agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

Make dashboard URL configurable for reverse-proxied deployments (AO_PUBLIC_URL)

Open thapecroth opened this issue 6 months ago • 2 comments

Summary

When AO runs behind a reverse proxy with a public hostname (Caddy / nginx / Cloudflare Tunnel / Traefik / a remote dev container fronted by anything), http://localhost:${port} is hardcoded throughout the CLI:

  • packages/cli/src/commands/dashboard.ts — startup banner, browser auto-open via waitForPortAndOpen
  • packages/cli/src/commands/start.ts (12 call sites) — spinner success line, every Dashboard: print, orchestrator URL fallback, openUrl() invocations, running-state reuse paths
  • packages/cli/src/lib/routes.ts — projectSessionUrl(), which is embedded directly in the orchestrator-agent prompt template

None of those URLs are reachable from outside the host.

Repro

  1. Run ao start on a remote machine (VM, container, VPS) and front it with any reverse proxy at a public hostname.
  2. From your workstation, navigate to the public URL and authenticate (if applicable) — the dashboard loads fine.
  3. On the remote host, observe ao start prints Dashboard: http://localhost:${port} — wrong host.
  4. ao open launches the wrong URL in the remote machine's (non-existent) browser, not your workstation's browser at the public URL.
  5. Inspect the orchestrator agent's prompt — embedded session links use http://localhost:${port}/projects/.../sessions/.... From the agent's POV those go nowhere useful.

Proposed

Add an AO_PUBLIC_URL env var. When set, all user-facing dashboard URLs use it instead of http://localhost:${port}. Internal IPC (the daemon hitting its own dashboard's /api/projects/reload) stays on localhost since that traffic never leaves the host — routing it through a public URL would just add latency and a failure surface (DNS, TLS, proxy hops) for a same-process call.

Implementation: single helper dashboardUrl(port) that returns process.env.AO_PUBLIC_URL?.trim().replace(/\/+$/, "") ?? \http://localhost:${port}``. Every user-facing call site goes through it.

PR addressing this: #1757 (first commit 526afad1)

thapecroth avatar May 10 '26 22:05 thapecroth

@prod-blip new issue from a non-collaborator.

OrcInc avatar May 12 '26 17:05 OrcInc

Hi @thapecroth , thanks for filing this, it is really detailed and useful. I'm a contributor on AO and trying to get a sense of how it's working for folks using it in real workflows. Would love to hear a bit more about your experience and happy to hop on a quick 15-min call if that's easier. Here’s my calendly link https://calendly.com/atulpandey-iift1618/30min

Also, the contributors meet on Discord every day at 10pm IST: https://discord.gg/6KgeUjbe — drop in if you're around, good place to see what's being worked on and shape direction directly.

prod-blip avatar May 22 '26 13:05 prod-blip