From 4c96172d9bee8542a356610802b9aabc1419f650 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sat, 18 Jul 2026 02:39:41 -0700 Subject: [PATCH] test: stub discover_local_cdp_url in CLI connect context-note test The dual-stack discovery change made the default-local /browser connect path call discover_local_cdp_url instead of is_browser_debug_ready, so the old is_browser_debug_ready patch no longer short-circuited the probe. On the CI runner nothing listens on 9222, so the test fell through to a REAL chromium launch (which dies headless: 'The platform failed to initialize') and no context note was queued. Patch the new discovery helper at the mixin's import site instead. --- tests/cli/test_cli_browser_connect.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/cli/test_cli_browser_connect.py b/tests/cli/test_cli_browser_connect.py index 950e990c83ddb..ef3a703db4834 100644 --- a/tests/cli/test_cli_browser_connect.py +++ b/tests/cli/test_cli_browser_connect.py @@ -342,7 +342,15 @@ class TestChromeDebugLaunch: cli._pending_input = Queue() monkeypatch.delenv("BROWSER_CDP_URL", raising=False) - with patch("hermes_cli.cli_commands_mixin.is_browser_debug_ready", return_value=True), \ + # The default-local path now resolves the endpoint via + # discover_local_cdp_url (dual-stack probe); patch it at the + # mixin's import site so no real network probe or browser + # launch happens on the test runner. + with patch( + "hermes_cli.cli_commands_mixin.discover_local_cdp_url", + return_value="http://127.0.0.1:9222", + ), \ + patch("hermes_cli.cli_commands_mixin.is_browser_debug_ready", return_value=True), \ patch("tools.browser_tool.cleanup_all_browsers"), \ patch("tools.browser_tool._ensure_cdp_supervisor"), \ redirect_stdout(StringIO()):