fix: protocolTimeout for heavy pages + attach-mode arg cleanup#11
Merged
Conversation
Two reliability fixes for symptoms hit on real workloads: 1. Heavy pages (e.g. Studio module dev bundles >100MB) cannot ack `Network.enable` and other auto-attached domain calls within puppeteer's default 180s timeout. Once it fires, the CDP connection is marked dead and every subsequent call throws — only daemon restart recovers. Bump `protocolTimeout` to 10min for both `puppeteer.connect` and `puppeteer.launch`, env-overridable via `BRAVE_DEVTOOLS_PROTOCOL_TIMEOUT_MS`. 2. `start --browserUrl X` was emitting `--browser-url X --headless --isolated` in the daemon args because the spawn-mode defaults (`headless: true`, `isolated: true`) were applied unconditionally after yargs parsing. The runtime resolver ignored them under attach mode but `status` showed misleading args, and the silent fallthrough would become a real bug if the resolver order ever changed. Detect attach mode (`browserUrl` / `wsEndpoint` / `autoConnect`) and strip spawn-only flags before serializing. Smoke-tested both modes: attach now reports `args=[--browser-url X, --category-..., ...]` and spawn still gets `[--headless, --isolated, ...]`. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
Two reliability fixes for real-world failures hit during a Brightcove Studio dev session:
1.
protocolTimeoutraised from puppeteer's 180s default to 10minHeavy pages (Studio module dev bundles ~160MB JS) cannot ack
Network.enableand other auto-attached CDP calls within 180s. Once the timeout fires, puppeteer marks the connection dead and every subsequent call throwsNetwork.enable timed out— only daemon restart recovers.Bumped to 600s on both
puppeteer.connect()andpuppeteer.launch(). Env-overridable viaBRAVE_DEVTOOLS_PROTOCOL_TIMEOUT_MS.2. Attach-mode
startno longer emits spawn-only flagsbrave-devtools start --browserUrl http://127.0.0.1:9222was producing args--browser-url X --headless --isolated. Runtime ignored them, butstatusshowed misleading output. Detect attach mode and strip spawn-only flags before serializing.Smoke test
Out of scope (separate PRs)
Network.enablewedge has no auto-recovery)Companion upstream PR
Mirror submitted to upstream chrome-devtools-mcp: ChromeDevTools#2009.
🤖 Generated with Claude Code