From 0a4e82ab2cb57f86cd8b0cd5f406fdcec266d288 Mon Sep 17 00:00:00 2001 From: Prateek Date: Tue, 17 Feb 2026 00:43:45 +0530 Subject: [PATCH] fix: start WebSocket terminal servers with dashboard `ao start` now runs `pnpm dev` instead of just `next dev`, which starts: - Next.js dashboard - Terminal WebSocket server (port 3002) - Direct terminal WebSocket server (port 3003) This fixes the "WebSocket connection error" when clicking the orchestrator terminal button. Previously only Next.js was started, breaking the terminal. Co-Authored-By: Claude Opus 4.6 --- packages/cli/src/commands/start.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index 913468b69..55be38d24 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -119,6 +119,7 @@ function resolveProject( /** * Start dashboard server in the background. + * Runs the full dev script which starts Next.js + WebSocket terminal servers. * Returns the child process handle for cleanup. */ function startDashboard(port: number, webDir: string, configPath: string): ChildProcess { @@ -127,7 +128,11 @@ function startDashboard(port: number, webDir: string, configPath: string): Child // Pass config path to dashboard so it uses the same config as ao start env["AO_CONFIG_PATH"] = configPath; - const child = spawn("npx", ["next", "dev", "-p", String(port)], { + // Set PORT for Next.js dev server (used by dev:next script) + env["PORT"] = String(port); + + // Run full dev script (Next.js + terminal WebSocket servers) + const child = spawn("pnpm", ["run", "dev"], { cwd: webDir, stdio: "inherit", detached: false,