fix(cli): kill-all should match cliDaemon.js entry point#40166
Open
bgilly wants to merge 1 commit intomicrosoft:mainfrom
Open
fix(cli): kill-all should match cliDaemon.js entry point#40166bgilly wants to merge 1 commit intomicrosoft:mainfrom
bgilly wants to merge 1 commit intomicrosoft:mainfrom
Conversation
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 microsoft#39632 but the case is wrong (camelCase vs hyphenated). - 'run-mcp-server' and 'run-cli-server' were argv tokens from the pre-microsoft#39632 daemon launch mechanism. They no longer appear in any process command line. Only the dashboardApp.js pattern added in microsoft#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 microsoft#40165
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #40165
Problem
playwright-cli kill-alldoes not kill any main daemon processes becausekillAllDaemonsintools/cli-client/program.tsgreps for substrings that don't match current daemon command lines. Full investigation and reproduction in the linked issue.Fix
Replace the three dead patterns (
run-mcp-server,run-cli-server,cli-daemon) withcliDaemon.js— the actual entry-point filename for daemons spawned fromsrc/entry/cliDaemon.ts. Keeps the workingdashboardApp.jspattern from #40004.Verification
Empirically verified on macOS 26.2 / Darwin 25.2.0 arm64,
@playwright/cli@0.1.6/ playwright-core1.60.0-alpha-1775584683000:pgrep -f cliDaemon.js→ 0 matches.playwright-cli open→ "Browserdefaultopened with pid 19665".pgrep -lf cliDaemon.js→ PID 19665.playwright-cli kill-all(with patched bundle):Killed daemon process 19665. Killed 1 daemon processes.pgrep -f cliDaemon.js→ 0 matches.playwright-cli list→(no browsers).Before the patch, step 4 produced
No daemon processes foundand the daemon survived.Notes
killAllDaemons. Happy to add a spawn-and-kill test in a follow-up if the minimal fix is acceptable.npm run lintpasses on the modified file locally.kill-all, its child browser process becomes an orphan because SIGKILL prevents the daemon from running a cleanup handler. Worth a follow-up to SIGTERM first with a brief grace period. Separate concern from the pattern mismatch fixed here.