fix(cli): reload dashboard config after adding project from already-running menu (#1706)

When `ao start` finds an existing daemon and the user picks "Add <dir>",
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.
This commit is contained in:
Harshit Singh Bhandari 2026-05-07 18:43:19 +05:30 committed by GitHub
parent 5c1d56aea4
commit 0f539a3d4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -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.

View File

@ -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);