Skip to content

Make pageId routing default to prevent multi-agent race conditions #1245

@bcfmtolgahan

Description

@bcfmtolgahan

Description of the bug

Problem

In multi-agent workflows (e.g., Claude Code with parallel agents), concurrent select_page calls create race conditions because select_page + action is not atomic. Agent A calls select_page(page1), then Agent B calls select_page(page2) before
Agent A's next tool call — Agent A now operates on the wrong page.

This is already solved by --experimental-page-id-routing, which allows tools to accept pageId directly. But since it's behind an experimental flag, most users don't know about it.

Proposal

  1. Make pageId always available on page-scoped tools (remove the experimental gate)
  2. Fix waitForEventsAfterAction to use the explicit target page's emulation settings instead of the global selected page — currently it reads CPU throttling / network conditions from #selectedPage, which may be a different page than the one being
    operated on

Reproduction

No response

Expectation

No response

MCP configuration

No response

Chrome DevTools MCP version

0.20.3

Chrome version

No response

Coding agent version

No response

Model version

No response

Chat log

No response

Node version

No response

Operating system

macOS

Extra checklist

  • I want to provide a PR to fix this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions