Skip to content

fix: protocolTimeout for heavy pages + attach-mode arg cleanup#11

Merged
triuzzi merged 1 commit into
mainfrom
feat/protocol-timeout-and-arg-conflicts
May 7, 2026
Merged

fix: protocolTimeout for heavy pages + attach-mode arg cleanup#11
triuzzi merged 1 commit into
mainfrom
feat/protocol-timeout-and-arg-conflicts

Conversation

@triuzzi
Copy link
Copy Markdown
Owner

@triuzzi triuzzi commented May 7, 2026

Summary

Two reliability fixes for real-world failures hit during a Brightcove Studio dev session:

1. protocolTimeout raised from puppeteer's 180s default to 10min

Heavy pages (Studio module dev bundles ~160MB JS) cannot ack Network.enable and other auto-attached CDP calls within 180s. Once the timeout fires, puppeteer marks the connection dead and every subsequent call throws Network.enable timed out — only daemon restart recovers.

Bumped to 600s on both puppeteer.connect() and puppeteer.launch(). Env-overridable via BRAVE_DEVTOOLS_PROTOCOL_TIMEOUT_MS.

2. Attach-mode start no longer emits spawn-only flags

brave-devtools start --browserUrl http://127.0.0.1:9222 was producing args --browser-url X --headless --isolated. Runtime ignored them, but status showed misleading output. Detect attach mode and strip spawn-only flags before serializing.

Smoke test

attach: args=["--browser-url","http://127.0.0.1:9222","--category-..."]    # clean
spawn:  args=["--headless","--isolated","--category-..."]                  # defaults still apply

Out of scope (separate PRs)

  • Per-tty daemon cleanup (10× stale daemons observed)
  • Hang recovery / health probe (Network.enable wedge has no auto-recovery)

Companion upstream PR

Mirror submitted to upstream chrome-devtools-mcp: ChromeDevTools#2009.

🤖 Generated with Claude Code

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>
@triuzzi triuzzi self-assigned this May 7, 2026
@triuzzi triuzzi merged commit 0bf8d55 into main May 7, 2026
1 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant