System info
Source code
Steps
- Start Playwright with
--debug=cli and connect an MCP client
- A script pauses via
page.pause() or requestPause()
- Call
browser_resume (no step or location params)
- The script completes without hitting another
page.pause()
Expected behavior
browser_resume should return once the debugger resumes execution.
Actual behavior
browser_resume hangs indefinitely. The handler unconditionally creates a promise waiting for the next pausedstatechanged event, but if execution completes without another breakpoint, pausedstatechanged never fires and the promise never resolves.
The hang is specific to a plain resume (no step or location). When step is set, it makes sense to wait for the next pause. When location is set, the handler sets a breakpoint, so a pause event is expected. A plain resume has no such expectation.
Use case
An MCP agent inspects the paused state (variables, DOM), then calls browser_resume to let the script finish. The agent does not know whether another page.pause() exists downstream. If the script completes normally, the agent is stuck.
This is the natural MCP workflow: pause, inspect, resume. The resume tool should not require the caller to predict whether the script will pause again.
System info
Source code
Steps
--debug=cliand connect an MCP clientpage.pause()orrequestPause()browser_resume(nosteporlocationparams)page.pause()Expected behavior
browser_resumeshould return once the debugger resumes execution.Actual behavior
browser_resumehangs indefinitely. The handler unconditionally creates a promise waiting for the nextpausedstatechangedevent, but if execution completes without another breakpoint,pausedstatechangednever fires and the promise never resolves.The hang is specific to a plain resume (no
steporlocation). Whenstepis set, it makes sense to wait for the next pause. Whenlocationis set, the handler sets a breakpoint, so a pause event is expected. A plain resume has no such expectation.Use case
An MCP agent inspects the paused state (variables, DOM), then calls
browser_resumeto let the script finish. The agent does not know whether anotherpage.pause()exists downstream. If the script completes normally, the agent is stuck.This is the natural MCP workflow: pause, inspect, resume. The resume tool should not require the caller to predict whether the script will pause again.