fix(chrome): probe IPv4 loopback in ensurePortAvailable to match Chrome CDP bind#94390
Closed
lsr911 wants to merge 1 commit into
Closed
fix(chrome): probe IPv4 loopback in ensurePortAvailable to match Chrome CDP bind#94390lsr911 wants to merge 1 commit into
lsr911 wants to merge 1 commit into
Conversation
…me CDP bind
ensurePortAvailable used bare net.listen({port}) which binds IPv6
wildcard on dual-stack, missing IPv4-only loopback occupants.
This caused Chrome CDP launch to fail with misleading HTTP 401
when 127.0.0.1:<port> was already in use.
Probe 127.0.0.1 explicitly to match the address family Chrome
binds its debugging port on.
Fixes openclaw#94379
Co-Authored-By: Claude <[email protected]>
|
Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
|
Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
This was referenced Jun 18, 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.
Summary
Fixes #94379
ensurePortAvailable()used barenet.listen({port})which binds the IPv6 wildcard on dual-stack hosts, missing IPv4-only loopback occupants. Chrome CDP binds on127.0.0.1, so the pre-flight guard was silently bypassed. Chrome then fails withbind() failed: Address already in usebut the user sees a misleadingHTTP 401.Root Cause
The address family the pre-flight probes (
::) does not match the address family Chrome binds (127.0.0.1). An IPv4-only occupant goes undetected.Change
src/infra/ports.ts— 1 lineProbe
127.0.0.1explicitly to match Chrome's CDP bind address family. The siblingcheckPortInUsealready probes all 4 loopback families — this alignsensurePortAvailablewith that pattern.Testing
pnpm not available in local environment — relying on CI verification.
🤖 Generated with Claude Code