Repository navigation
Fix auto-attach failing when launching a new Edge instance - #5081
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 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.launchwith 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
Guangyue Xu (guangyuexu)
approved these changes
Nov 2, 2026
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.

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.