fix(cli): check /browser status against configured CDP host#8257
Open
liu-collab wants to merge 2 commits intoNousResearch:mainfrom
Open
fix(cli): check /browser status against configured CDP host#8257liu-collab wants to merge 2 commits intoNousResearch:mainfrom
liu-collab wants to merge 2 commits intoNousResearch:mainfrom
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.
What does this PR do?
This fixes
/browser statusand the/browser connectreachability check when Hermes is connected to a non-local CDP endpoint.Previously, the CLI always checked
127.0.0.1:<port>even whenBROWSER_CDP_URLor/browser connectpointed at a different host, such as a Windows host IP from WSL2. That caused falsenot reachablewarnings even when the configured remote CDP endpoint was the correct one.This change makes Hermes parse the configured CDP URL and check the actual host/port from that endpoint instead of hardcoding localhost.
Related Issue
No existing issue or PR found for this specific
/browser statusremote-host false-negative bug.Type of Change
Changes Made
cli.py_get_cdp_socket_target()to extract host/port from configured CDP URLs_is_cdp_endpoint_reachable()so reachability checks use the configured endpoint host instead of always probing127.0.0.1/browser connectand/browser statusto use the configured CDP host/porttests/cli/test_cli_browser_connect.py/browser statuschecks the configured endpoint valueHow to Test
/browser connect http://<windows-host-ip>:9222/browser status127.0.0.1:9222Static validation run in this environment:
I could not run the targeted pytest file in this environment because
pytestis not installed in the local WSL runtime used for validation.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Before fix,
/browser statuscould show:because the code probed
127.0.0.1:9222instead of the configured endpoint host.