Skip to content

kill-all SIGKILLs unrelated processes (and its own caller) that mention a daemon file name #501

Closed

Description

killAllDaemons() (cli-client/program.ts) kills every process whose full command line contains one of run-mcp-server, run-cli-server, cli-daemon, cliDaemon.js, dashboardApp.js.

Linux (reproduced)

touch ~/logs/cli-daemon.log
tail -f ~/logs/cli-daemon.log &
bash -c 'echo cli-daemon; playwright-cli kill-all; echo "caller survived"'

Output, with no browser sessions open:

Killed daemon process 922    <- tail -f ~/logs/cli-daemon.log
Killed daemon process 924    <- the bash -c that invoked kill-all (exit 137, "caller survived" never printed)
Killed 2 daemon processes.

Anything that merely mentions those strings — tail/less/vim on a log or source file, grep cli-daemon, or an agent's bash -c whose script text contains them — is SIGKILLed, including other users' processes where permitted.

Windows (from code reading, not run)

The PowerShell command built by kill-all contains its own patterns ($_.CommandLine -like '*cli-daemon*'), as does the cmd.exe that execSync spawns, so the filter matches the PowerShell process itself. It will Stop-Process itself mid-pipeline, execSync throws, the error is swallowed, and kill-all reports nothing killed while real daemons may survive.

Suggested fix

Match on the daemon's entry script argument (e.g. argv[1] ending in entry/cliDaemon.js under this package's libPath), or better, record daemon PIDs in the .session files and kill only those; always exclude process.pid and its ancestors.

Environment

  • @playwright/cli 0.1.23 (main @ f50f579), playwright-core 1.65.0-alpha-2026-10-30
  • Node 22.23.4, Linux x64, Chrome for Testing 153

Activity

  1. pavelfeldman commented on Nov 5, 2026

    @pavelfeldman
    Member

    Low impact, accepting the gap in the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions