From 2934c52fe6421f5264b5b84c12a0a1ec3c29126d Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 10 Apr 2026 22:09:51 -0700 Subject: [PATCH] fix(cli): kill-all should match cliDaemon.js entry point killAllDaemons grepped process command lines for 'cli-daemon', 'run-mcp-server', and 'run-cli-server'. None of these match real daemons today: - 'cli-daemon' was intended to match the cliDaemon.js entry point added in #39632 but the case is wrong (camelCase vs hyphenated). - 'run-mcp-server' and 'run-cli-server' were argv tokens from the pre-#39632 daemon launch mechanism. They no longer appear in any process command line. Only the dashboardApp.js pattern added in #40004 matched anything. Replace the three dead patterns with 'cliDaemon.js'. Verified empirically on macOS: kill-all now kills real orphan daemons where it previously reported "No daemon processes found." Fixes #40165 --- packages/playwright-core/src/tools/cli-client/program.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/playwright-core/src/tools/cli-client/program.ts b/packages/playwright-core/src/tools/cli-client/program.ts index 2cc80fa22e1c3..e54ecd7fe7051 100644 --- a/packages/playwright-core/src/tools/cli-client/program.ts +++ b/packages/playwright-core/src/tools/cli-client/program.ts @@ -254,7 +254,7 @@ async function killAllDaemons(): Promise { const result = execSync( `powershell -NoProfile -NonInteractive -Command ` + `"Get-CimInstance Win32_Process ` - + `| Where-Object { $_.CommandLine -like '*run-mcp-server*' -or $_.CommandLine -like '*run-cli-server*' -or $_.CommandLine -like '*cli-daemon*' -or $_.CommandLine -like '*dashboardApp.js*' } ` + + `| Where-Object { $_.CommandLine -like '*cliDaemon.js*' -or $_.CommandLine -like '*dashboardApp.js*' } ` + `| ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; $_.ProcessId }"`, { encoding: 'utf-8' } ); @@ -268,7 +268,7 @@ async function killAllDaemons(): Promise { const result = execSync('ps aux', { encoding: 'utf-8' }); const lines = result.split('\n'); for (const line of lines) { - if (line.includes('run-mcp-server') || line.includes('run-cli-server') || line.includes('cli-daemon') || line.includes('dashboardApp.js')) { + if (line.includes('cliDaemon.js') || line.includes('dashboardApp.js')) { const parts = line.trim().split(/\s+/); const pid = parts[1]; if (pid && /^\d+$/.test(pid)) {