fix(runtime): honor OPENCLI_CDP_ENDPOINT for web adapters#2148
Open
axxop wants to merge 1 commit into
Open
Conversation
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.
Problem
OPENCLI_CDP_ENDPOINTis documented as the manual CDP endpoint override, but regular website adapters ignore it.getBrowserFactory()selectsCDPBridgeonly for registered Electron apps and always selectsBrowserBridgefor sites such asxianyu.As a result, a command such as:
still tries to connect through the Browser Bridge daemon. In a setup with multiple connected extension profiles, it fails with
BROWSER_CONNECT: Multiple Browser Bridge profiles are connected, even though the explicitly configured headless Chrome CDP endpoint is reachable and authenticated.Fix
Give an explicitly configured
OPENCLI_CDP_ENDPOINTprecedence ingetBrowserFactory()and selectCDPBridgefor any adapter when it is present. Existing behavior is unchanged when the variable is absent: registered Electron apps still use CDP and regular sites still use Browser Bridge.Add regression coverage for both branches:
BrowserBridgeby defaultCDPBridgewhenOPENCLI_CDP_ENDPOINTis configuredVerification
npx vitest run --project unit src/runtime.test.ts— 2 passednpm run typecheck— clean--headless=new --remote-debugging-port=9333:opencli xianyu whoami -f jsonreturnedlogged_in: truethrough the manual CDP endpoint.