Skip to content

Fix auto-attach failing when launching a new Edge instance - #5081

Merged
Vidal Ortega (vidorteg) merged 4 commits into
mainfrom
user/vidorteg/fix-launch-scenario
Nov 3, 2026
Merged

Vidal Ortega (vidorteg) merged 4 commits into
mainfrom
user/vidorteg/fix-launch-scenario

Conversation

@vidorteg

@vidorteg Vidal Ortega (vidorteg) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Launching a new Edge instance sometimes failed to auto-attach DevTools, because Edge can hand off to another process and exit before its debugging port is ready.

Instead of relying on puppeteer.launch, the extension now starts Edge itself and keeps retrying the connection to the debugging port until a page is available or the configured timeout expires.

The launch only fails early if Edge exits with an error code, and the existing timeout setting is now respected for all launch paths.

@vidorteg Vidal Ortega (vidorteg) changed the title Fix auto-attach when Edge hands off to another process during launch Fix auto-attach failing when launching a new Edge instance Oct 30, 2026
@vidorteg
Vidal Ortega (vidorteg) marked this pull request as ready for review October 30, 2026 22:08
Copilot AI balanced review requested due to automatic review settings October 30, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Connection attempts can exceed the launch deadline without being interrupted by process failures, and failed launches can leave owned Edge processes running.

2 open issues
What changed in this PR

This PR addresses intermittent DevTools auto-attach failures when Edge hands off startup to another process and exits before its debugging port is ready.

Changes:

  • Replaces puppeteer.launch with direct process spawning, connection retries, and page-readiness checks.
  • Passes the configured timeout through normal and remote launch paths.
  • Updates mocks and adds launcher tests for handoffs, startup failures, timeouts, and disconnection.
File Description
test/​utils.test.ts Verifies launcher delegation, arguments, and default timeout.
test/​puppeteerCoreStub.ts Replaces the launch mock with argument and connection mocks.
test/​extension.test.ts Updates launch expectations to include the timeout.
test/​browserLauncher.test.ts Adds coverage for connection retries and launch outcomes.
src/​utils.ts Delegates browser startup to the new helper with a timeout.
src/​extension.ts Forwards configured timeouts across browser launch paths.
src/​browserLauncher.ts Implements Edge spawning, connection retries, and page-readiness checks.

Review effort: Balanced

Comment thread src/browserLauncher.ts Resolved
Comment thread src/browserLauncher.ts Resolved

@guangyuexu Guangyue Xu (guangyuexu) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/browserLauncher.ts Resolved
Comment thread src/browserLauncher.ts Resolved
@vidorteg
Vidal Ortega (vidorteg) merged commit 4c8dda5 into main Nov 3, 2026
7 checks passed
@vidorteg
Vidal Ortega (vidorteg) deleted the user/vidorteg/fix-launch-scenario branch November 3, 2026 01:58
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.

3 participants