hermes - 💡(How to fix) Fix [Bug]: Chrome launched but port 9222 isn't responding yet in WSL when execute `/browser connect` [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  1. Error appear: Chrome launched but port 9222 isn't responding yet

Additional Logs / Traceback (optional)

Root Cause

In WSL, platform.system() returns "Linux", but browser binaries may be Windows executables located under /mnt/c/.... The code was passing a Unix path (e.g., /home/user/.hermes/chrome-debug) to a Windows Chrome binary, which cannot use it.

Fix Action

Fixed

Code Example

2026-05-17 00:32:16,003 WARNING tools.browser_supervisor: CDP supervisor default: connect failed (attempt 1): [Errno 111] Connect call failed ('127.0.0.1', 9222)
2026-05-17 00:32:17,007 WARNING tools.browser_supervisor: CDP supervisor default: connect failed (attempt 2): [Errno 111] Connect call failed ('127.0.0.1', 9222)
2026-05-17 00:33:26,277 WARNING tools.browser_tool: Failed to resolve CDP endpoint ws://localhost:9222 via http://localhost:9222/json/version: HTTPConnectionPool(host='localhost', port=9222): Max retries exceeded with url: /json/version (Caused by NewConnectionError("HTTPConnection(host='localhost', port=9222): Failed to establish a new connection: [Errno 111] Connection refused"))
2026-05-17 00:33:26,279 WARNING tools.browser_tool: Failed to resolve CDP endpoint ws://localhost:9222 via http://localhost:9222/json/version: HTTPConnectionPool(host='localhost', port=9222): Max retries exceeded with url: /json/version (Caused by NewConnectionError("HTTPConnection(host='localhost', port=9222): Failed to establish a new connection: [Errno 111] Connection refused"))
2026-05-17 00:33:26,281 WARNING tools.browser_tool: Failed to resolve CDP endpoint ws://localhost:9222 via http://localhost:9222/json/version: HTTPConnectionPool(host='localhost', port=9222): Max retries exceeded with url: /json/version (Caused by NewConnectionError("HTTPConnection(host='localhost', port=9222): Failed to establish a new connection: [Errno 111] Connection refused"))

---
RAW_BUFFERClick to expand / collapse

Bug Description

When running hermes-agent in WSL (Windows Subsystem for Linux) and executing /browser connect:

⚙️ /browser connect Chrome isn't running with remote debugging — attempting to launch... ⚠ Chrome launched but port 9222 isn't responding yet Try again in a few seconds — the debug instance may still be starting

Steps to Reproduce

  1. Run "hermes chat" in WSL
  2. Execute /browser connect
  3. Error appear: Chrome launched but port 9222 isn't responding yet

Expected Behavior

Browser connected to live Chrome via CDP

Actual Behavior

Chrome launched but port 9222 isn't responding yet

<img width="1363" height="355" alt="Image" src="https://github.com/user-attachments/assets/8ecbb4e4-4453-46d9-b143-4ebdd4c64df7" />

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

2026-05-17 00:32:16,003 WARNING tools.browser_supervisor: CDP supervisor default: connect failed (attempt 1): [Errno 111] Connect call failed ('127.0.0.1', 9222)
2026-05-17 00:32:17,007 WARNING tools.browser_supervisor: CDP supervisor default: connect failed (attempt 2): [Errno 111] Connect call failed ('127.0.0.1', 9222)
2026-05-17 00:33:26,277 WARNING tools.browser_tool: Failed to resolve CDP endpoint ws://localhost:9222 via http://localhost:9222/json/version: HTTPConnectionPool(host='localhost', port=9222): Max retries exceeded with url: /json/version (Caused by NewConnectionError("HTTPConnection(host='localhost', port=9222): Failed to establish a new connection: [Errno 111] Connection refused"))
2026-05-17 00:33:26,279 WARNING tools.browser_tool: Failed to resolve CDP endpoint ws://localhost:9222 via http://localhost:9222/json/version: HTTPConnectionPool(host='localhost', port=9222): Max retries exceeded with url: /json/version (Caused by NewConnectionError("HTTPConnection(host='localhost', port=9222): Failed to establish a new connection: [Errno 111] Connection refused"))
2026-05-17 00:33:26,281 WARNING tools.browser_tool: Failed to resolve CDP endpoint ws://localhost:9222 via http://localhost:9222/json/version: HTTPConnectionPool(host='localhost', port=9222): Max retries exceeded with url: /json/version (Caused by NewConnectionError("HTTPConnection(host='localhost', port=9222): Failed to establish a new connection: [Errno 111] Connection refused"))

Operating System

Ubuntu 22.04

Python Version

3.11.15

Hermes Version

v0.14.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

Problem

When running hermes-agent in WSL (Windows Subsystem for Linux) and launching Chrome/Edge via try_launch_chrome_debug(), the CDP (Chrome DevTools Protocol) connection fails because Chrome cannot interpret the Unix-format --user-data-dir path.

Root Cause

In WSL, platform.system() returns "Linux", but browser binaries may be Windows executables located under /mnt/c/.... The code was passing a Unix path (e.g., /home/user/.hermes/chrome-debug) to a Windows Chrome binary, which cannot use it.

Scenario

# WSL environment:
platform.system() = "Linux"
Chrome binary = "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"  # Windows binary!
--user-data-dir=/home/nxy/.hermes/chrome-debug  # Unix path - Chrome can't use this!

### Proposed Fix (optional)

Add WSL detection and path translation to browser_connect.py:
1. _is_wsl() — detect WSL by checking /proc/version for "microsoft" or "WSL"
2. _is_windows_chrome_path(path) — check if Chrome path starts with /mnt/
3. _translate_path_to_windows(unix_path) — call wslpath -w to convert Unix→Windows path
4. _chrome_debug_args() — now accepts user_data_dir, system, chrome_path params; handles WSL path translation internally

### Are you willing to submit a PR for this?

- [x] I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: Chrome launched but port 9222 isn't responding yet in WSL when execute `/browser connect` [1 pull requests]