Skip to content

expect-cli mcp can leave orphaned Playwright/ffmpeg processes pegging CPU on macOS #98

@danieljvdm

Description

@danieljvdm

Hit this today and it was destroying my laptop. After tracing it down, the culprit was expect-cli mcp leaving behind a stale Playwright/browser-mcp process tree with a bunch of orphaned Chromium GPU processes and ffmpeg recorders. This was being spawned by codex cli processes. All of the codex processes had been shut down, but these expect processes were left behind.

What I found on macOS:

  • multiple chrome-headless-shell --type=gpu-process processes sitting around for 1h+ at roughly 150-400% CPU each
  • several ffmpeg-mac processes also still running
  • parent process was .../expect-cli/dist/browser-mcp.js
  • one stale browser-mcp.js process had become orphaned under launchd, while a fresh expect-cli helper had already restarted separately

This is the kind of tree I was seeing:

  • npm exec expect-cli@latest mcp
  • node .../.bin/expect-cli mcp
  • node .../expect-cli/dist/browser-mcp.js
  • chrome-headless-shell
  • chrome-headless-shell --type=gpu-process
  • ffmpeg-mac

Before cleanup the machine was basically pinned:

  • load avg spiked over 80
  • CPU idle was effectively 0%
  • after killing the orphaned browser-mcp parent and its Chromium/ffmpeg children, CPU went back to ~81% idle and the machine cooled off right away

Feels like the MCP/browser layer is not reliably cleaning up Playwright browser/video processes when a session exits, restarts, or gets detached.

If it helps, the hot Chromium processes were all running with flags like --headless --use-gl=angle --use-angle=swiftshader --enable-webgl.

Happy to grab more info if there’s a specific log or repro path you want.

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