From 0f539a3d4ec7ecaefbc4f2e71468a2ab1bfcec92 Mon Sep 17 00:00:00 2001 From: Harshit Singh Bhandari Date: Thu, 7 May 2026 18:43:19 +0530 Subject: [PATCH] fix(cli): reload dashboard config after adding project from already-running menu (#1706) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When `ao start` finds an existing daemon and the user picks "Add ", the project is written to the global config but the dashboard's cached services (loaded once into globalThis) never see it, so visiting the new project page renders notFound(). Call notifyProjectChange() after the write — same pattern as attachAndSpawnOrchestrator — so the dashboard invalidates its cache before the browser opens. --- .changeset/reload-dashboard-on-add-project.md | 5 +++++ packages/cli/src/commands/start.ts | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 .changeset/reload-dashboard-on-add-project.md diff --git a/.changeset/reload-dashboard-on-add-project.md b/.changeset/reload-dashboard-on-add-project.md new file mode 100644 index 000000000..b947fdde9 --- /dev/null +++ b/.changeset/reload-dashboard-on-add-project.md @@ -0,0 +1,5 @@ +--- +"@aoagents/ao-cli": patch +--- + +Fix dashboard 404 after adding a project from the "AO is already running" menu. The CLI now notifies the running daemon to reload its cached config so the new project's page is reachable immediately. diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index bd4a36545..f76ee508e 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -1411,6 +1411,14 @@ export function registerStart(program: Command): void { `\n✓ Added "${addedId}" — open the dashboard to start an orchestrator.\n`, ), ); + const notifyResult = await attachToDaemon(running).notifyProjectChange(); + if (!notifyResult.ok) { + console.log( + chalk.yellow( + ` ⚠ ${notifyResult.reason}. Refresh the page if the project doesn't show up.`, + ), + ); + } openUrl(`http://localhost:${running.port}`); unlockStartup(); process.exit(0);