Make dashboard URL configurable for reverse-proxied deployments (AO_PUBLIC_URL)
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 viawaitForPortAndOpenpackages/cli/src/commands/start.ts(12 call sites) — spinner success line, everyDashboard:print, orchestrator URL fallback,openUrl()invocations, running-state reuse pathspackages/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
- Run
ao starton a remote machine (VM, container, VPS) and front it with any reverse proxy at a public hostname. - From your workstation, navigate to the public URL and authenticate (if applicable) — the dashboard loads fine.
- On the remote host, observe
ao startprintsDashboard: http://localhost:${port}— wrong host. ao openlaunches the wrong URL in the remote machine's (non-existent) browser, not your workstation's browser at the public URL.- 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)
@prod-blip new issue from a non-collaborator.
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.