From 6031f2e96243ac7db8e19aeece05ead09c6a0ab4 Mon Sep 17 00:00:00 2001 From: Priyanshu Choudhary <57816400+Priyanchew@users.noreply.github.com> Date: Wed, 8 Apr 2026 21:28:38 +0530 Subject: [PATCH] fix(cli): add detached: !isWindows() to dashboard spawn for correct process cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without detached:true on Unix, killProcessTree(pid) calls process.kill(-pid) which targets a process group the child never owns — ESRCH causes fallback to direct kill, leaving grandchild processes alive. Matches the pattern already used in start.ts lines 782 and 795. Co-Authored-By: Claude Sonnet 4.6 --- packages/cli/src/commands/dashboard.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/dashboard.ts b/packages/cli/src/commands/dashboard.ts index 3181563b2..d62472e7c 100644 --- a/packages/cli/src/commands/dashboard.ts +++ b/packages/cli/src/commands/dashboard.ts @@ -2,7 +2,7 @@ import { spawn } from "node:child_process"; import { resolve } from "node:path"; import chalk from "chalk"; import type { Command } from "commander"; -import { killProcessTree, loadConfig } from "@composio/ao-core"; +import { isWindows, killProcessTree, loadConfig } from "@composio/ao-core"; import { findWebDir, buildDashboardEnv, waitForPortAndOpen } from "../lib/web-dir.js"; import { findRunningDashboardPid, @@ -67,6 +67,7 @@ export function registerDashboard(program: Command): void { const child = spawn("node", [startScript], { cwd: webDir, stdio: ["inherit", "inherit", "pipe"], + detached: !isWindows(), env, });