Skip to content

Commit fed59c3

Browse files
committed
feat(agent-browser, docs): overhaul CDP docs + add Windows mirrored networking guide
Bump agent-browser from pinned 0.11.1 to latest. Rewrite all CDP documentation to cover Chrome 136+ --user-data-dir requirement, Chrome 144+ checkbox method, and host.docker.internal for container networking. Add new Windows Networking guide for WSL 2 mirrored mode as the recommended Windows port-forwarding approach. Cross-reference from before-you-install, accessing-services, troubleshooting, and devcontainer-cli pages.
1 parent 0e13284 commit fed59c3

13 files changed

Lines changed: 379 additions & 32 deletions

File tree

container/.devcontainer/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@
2929
- **Install order guaranteed** — oh-my-claude added to `overrideFeatureInstallOrder` in devcontainer.json.
3030
- **Documentation** — added Known Limitations section covering expected `omc doctor` failures, missing slash commands (upstream issue), and role agent filtering.
3131

32+
### Agent Browser
33+
34+
- **Version bumped to latest** — updated from pinned 0.11.1; picks up `--auto-connect` fixes and CDP improvements through v0.26.0
35+
- **Host Chrome CDP documentation overhauled** — corrected Chrome version requirements (136+ needs `--user-data-dir`, 144+ has `chrome://inspect` checkbox), documented `host.docker.internal` for container-to-host networking, fixed flag naming (`--auto-connect` not `--autoConnect`), added Windows PowerShell launch commands
36+
37+
### Documentation
38+
39+
- **New guide: Windows Networking** — comprehensive WSL 2 mirrored networking setup for Windows users; recommended approach for port forwarding, replacing `dbr` on Windows
40+
- **Cross-references added** — before-you-install, accessing-services, troubleshooting, and devcontainer-cli pages now link to the Windows networking guide
41+
- **Agent-browser CDP troubleshooting** — new troubleshooting section for host Chrome connection issues (localhost vs host.docker.internal, Chrome version requirements, port exposure)
42+
3243
## v2.2.1 — 2026-04-16
3344

3445
### Configuration

container/.devcontainer/features/agent-browser/README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,26 @@ agent-browser close
4848

4949
### Host Chrome Connection
5050

51-
Connect to Chrome running on your host machine via CDP (Chrome DevTools Protocol):
51+
Connect to Chrome running on your host machine via CDP (Chrome DevTools Protocol). Useful when the container's bundled Chromium is insufficient (e.g., specific browser extensions or logged-in sessions needed).
5252

53-
1. Start Chrome on host with remote debugging:
54-
```bash
55-
chrome --remote-debugging-port=9222
56-
# or on macOS:
57-
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
58-
```
53+
**Chrome 144+** (recommended): No CLI launch needed. Enable remote debugging via a checkbox:
54+
1. Open `chrome://inspect/#remote-debugging` in Chrome
55+
2. Check "Enable remote debugging" — Chrome listens on port 9222 by default
5956

60-
2. Connect from container:
61-
```bash
62-
agent-browser connect 9222
63-
```
57+
**Chrome 136–143**: Chrome 136+ requires `--user-data-dir` alongside `--remote-debugging-port` or the flag is silently ignored:
6458

65-
This is useful when the container's bundled Chromium is insufficient (e.g., specific browser extensions needed).
59+
```bash
60+
# Linux / macOS
61+
google-chrome --remote-debugging-port=9222 --user-data-dir="/tmp/chrome-debug"
62+
63+
# Windows PowerShell
64+
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="$env:TEMP\chrome-debug"
65+
```
66+
67+
Connect from the container using `host.docker.internal` — not `localhost`, which refers to the container itself:
68+
69+
```bash
70+
agent-browser connect host.docker.internal:9222
71+
```
72+
73+
> **Security note:** CDP exposes the full browser session (cookies, storage, DOM) to anything that can reach the debug port. Use with caution on shared or networked machines.

container/.devcontainer/features/agent-browser/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"version": {
99
"type": "string",
1010
"description": "agent-browser npm package version",
11-
"default": "0.11.1"
11+
"default": "latest"
1212
},
1313
"username": {
1414
"type": "string",

container/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/skills/agent-browser/SKILL.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ agent-browser close
6161
| `fill @eN "text"` | Type text into an input element | `agent-browser fill @e3 "hello"` |
6262
| `select @eN "value"` | Select an option from a dropdown | `agent-browser select @e5 "option1"` |
6363
| `cookie set "..."` | Set a cookie for authenticated sessions | `agent-browser cookie set "session=abc123; domain=.example.com"` |
64-
| `connect <port>` | Connect to host Chrome via CDP | `agent-browser connect 9222` |
64+
| `connect <host:port>` | Connect to host Chrome via CDP | `agent-browser connect host.docker.internal:9222` |
6565
| `close` | End the browser session | `agent-browser close` |
6666

6767
> **Full details:** See `references/cli-reference.md` for complete command syntax, output formats, and all options.
@@ -121,25 +121,38 @@ agent-browser close
121121

122122
### Host Chrome Connection
123123

124-
Connect to Chrome running on your host machine via CDP (Chrome DevTools Protocol). Useful when the container's bundled Chromium is insufficient (e.g., specific browser extensions needed):
124+
Connect to Chrome running on your host machine via CDP (Chrome DevTools Protocol). Useful when the container's bundled Chromium is insufficient (e.g., specific browser extensions or logged-in sessions needed).
125125

126-
1. Start Chrome on host with remote debugging:
127-
```bash
128-
chrome --remote-debugging-port=9222
129-
```
126+
**Chrome 144+** (recommended): No CLI launch needed. Enable remote debugging via a checkbox:
127+
1. Open `chrome://inspect/#remote-debugging` in Chrome
128+
2. Check "Enable remote debugging" — Chrome listens on port 9222 by default
130129

131-
2. Connect from container:
132-
```bash
133-
agent-browser connect 9222
134-
```
130+
**Chrome 136–143**: Chrome 136+ requires `--user-data-dir` alongside `--remote-debugging-port` or the flag is silently ignored:
131+
132+
```bash
133+
# Linux / macOS
134+
google-chrome --remote-debugging-port=9222 --user-data-dir="/tmp/chrome-debug"
135+
136+
# Windows PowerShell
137+
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="$env:TEMP\chrome-debug"
138+
```
139+
140+
Connect from the container — always use `host.docker.internal`, not `localhost`:
141+
142+
```bash
143+
agent-browser connect host.docker.internal:9222
144+
```
145+
146+
For Windows users, [mirrored networking](/start-here/windows-networking/) provides the smoothest experience for host Chrome CDP and general port forwarding.
135147

136148
---
137149

138150
## Ambiguity Policy
139151

140152
These defaults apply when the user does not specify a preference. State the assumption when applying a default:
141153

142-
- **Mode:** Always use headless mode (bundled Chromium) unless the user explicitly requests host Chrome connection
154+
- **Mode:** Always use headless mode (bundled Chromium) unless the user explicitly requests host Chrome connection. When host Chrome is requested, default to `host.docker.internal:9222` as the CDP endpoint.
155+
- **Networking:** When connecting to host Chrome from inside a container, always use `host.docker.internal` — never `localhost`
143156
- **Snapshot first:** Always run `snapshot` before interacting with elements — never guess element references
144157
- **Snapshot after:** Always run `snapshot` after interactions to verify results
145158
- **Close when done:** Always `close` the browser session when the task is complete

container/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/skills/agent-browser/references/cli-reference.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,29 +187,38 @@ agent-browser cookie set "auth_token=xyz789; domain=.app.example.com; path=/; se
187187
Connects to a Chrome instance running on the host via Chrome DevTools Protocol (CDP).
188188
189189
```bash
190-
agent-browser connect <port>
190+
agent-browser connect <host:port>
191191
```
192192
193193
**Arguments:**
194-
- `<port>` — The remote debugging port Chrome is listening on
194+
- `<host:port>` — The CDP endpoint. Use `host.docker.internal:9222` when running inside a devcontainer.
195195
196196
**Prerequisites:**
197-
Chrome must be started on the host with remote debugging enabled:
197+
Chrome must have remote debugging enabled on the host before connecting.
198+
199+
**Chrome 144+** (recommended): No CLI launch needed. Enable via a checkbox:
200+
1. Open `chrome://inspect/#remote-debugging` in Chrome
201+
2. Check "Enable remote debugging" — Chrome listens on port 9222 by default
202+
203+
**Chrome 136–143**: Chrome 136+ requires `--user-data-dir` alongside `--remote-debugging-port` or the flag is silently ignored:
198204
```bash
199-
chrome --remote-debugging-port=9222
200-
# macOS:
201-
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
205+
# Linux / macOS
206+
google-chrome --remote-debugging-port=9222 --user-data-dir="/tmp/chrome-debug"
207+
208+
# Windows PowerShell
209+
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="$env:TEMP\chrome-debug"
202210
```
203211

204212
**Examples:**
205213
```bash
206-
agent-browser connect 9222
214+
agent-browser connect host.docker.internal:9222
207215
```
208216

209217
**When to use:**
210218
- When the container's bundled Chromium is insufficient
211219
- When specific browser extensions are needed
212220
- When you need to observe browser behavior visually on the host
221+
- When you need access to a logged-in Chrome session (cookies, extensions, saved passwords)
213222
214223
---
215224
@@ -237,6 +246,8 @@ agent-browser close
237246
| Element not found | Reference ID from stale snapshot | Run `snapshot` again to get current references |
238247
| Session already active | Tried to `open` without `close` | Run `close` first, then `open` |
239248
| Connection refused (CDP) | Host Chrome not running with debug port | Start Chrome with `--remote-debugging-port` |
249+
| Connection refused via localhost | Container cannot reach host on localhost | Use `host.docker.internal:9222` instead of `localhost:9222` |
250+
| Chrome ignores --remote-debugging-port | Chrome 136+ requires --user-data-dir | Add `--user-data-dir` flag when launching Chrome |
240251
241252
**General recovery pattern:**
242253
```bash

container/.devcontainer/plugins/devs-marketplace/plugins/skill-engine/skills/agent-browser/references/workflow-patterns.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,59 @@ agent-browser close
146146
147147
---
148148
149+
## Host Chrome CDP Session
150+
151+
Connect to Chrome running on your host machine to use an existing logged-in session, extensions, or saved passwords. This is the recommended approach when the container's bundled Chromium cannot access what you need.
152+
153+
### Prerequisites
154+
155+
The user must enable Chrome remote debugging on their host machine before you can connect.
156+
157+
**Chrome 144+** (recommended): No CLI launch needed. The user enables remote debugging via a checkbox:
158+
1. Open `chrome://inspect/#remote-debugging` in Chrome
159+
2. Check "Enable remote debugging"
160+
3. Chrome listens on port 9222 by default
161+
162+
**Chrome 136–143**: Launch Chrome with explicit flags:
163+
164+
```bash
165+
# Linux / macOS
166+
google-chrome --remote-debugging-port=9222 --user-data-dir="/tmp/chrome-debug"
167+
168+
# Windows PowerShell
169+
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="$env:TEMP\chrome-debug"
170+
```
171+
172+
> **Why `--user-data-dir`?** Chrome 136+ silently ignores `--remote-debugging-port` unless a user data directory is also specified.
173+
174+
### Workflow
175+
176+
```bash
177+
# Connect to host Chrome from inside the container
178+
agent-browser connect host.docker.internal:9222
179+
180+
# Snapshot to see what's currently open
181+
agent-browser snapshot
182+
183+
# Navigate to a page (uses host Chrome's cookies and extensions)
184+
agent-browser open https://example.com/dashboard
185+
186+
# Interact normally
187+
agent-browser snapshot
188+
agent-browser click @e3
189+
190+
# Close the CDP connection (does not close Chrome on the host)
191+
agent-browser close
192+
```
193+
194+
**Key points:**
195+
- Always use `host.docker.internal:9222` from inside a devcontainer — `localhost` refers to the container itself
196+
- The CDP connection gives you access to the host Chrome's full session: cookies, localStorage, extensions, saved passwords
197+
- Closing the agent-browser session does not close Chrome on the host
198+
- For Windows users needing broader port forwarding, see [Windows Mirrored Networking](/start-here/windows-networking/)
199+
200+
---
201+
149202
## Screenshot Capture
150203
151204
Take screenshots for visual verification at key points:

docs/astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ export default defineConfig({
9393
label: "Before You Install",
9494
slug: "start-here/before-you-install",
9595
},
96+
{
97+
label: "Windows Networking",
98+
slug: "start-here/windows-networking",
99+
},
96100
{
97101
label: "Install in VS Code",
98102
slug: "start-here/install-in-vscode",

docs/src/content/docs/reference/changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ For minor and patch updates, you can usually just rebuild the container. Check t
5454
- **New feature: `hermes-agent`** — installs [Nous Research's Hermes Agent](https://hermes-agent.nousresearch.com/) CLI via the upstream `curl | bash` installer with `--skip-setup`. Hermes uses the plain `anthropic` / `openai` Python SDKs directly and supports any compatible provider (Anthropic, OpenAI, MiniMax, local models). Enabled by default; set `"version": "none"` in `devcontainer.json` to disable.
5555
- **Hermes persistence** — dedicated Docker named volume (`codeforge-hermes-config-${devcontainerId}`) for `~/.hermes/`, surviving container rebuilds so `hermes setup` is a one-time cost per devcontainer instance.
5656
- **No credential seeding** — the interactive `hermes setup` wizard is intentionally skipped during image build. Run `hermes setup` on first use to pick a provider and paste an API key (e.g. from `$MINIMAX_API_KEY`, which already has a slot in `.secrets.example`). Claude OAuth / Codex ChatGPT OAuth cannot be reused — Hermes needs its own provider auth.
57+
- **Install script now warns on unsupported `version` values** — Hermes upstream has not tagged releases yet, so anything other than `latest` or `none` silently installed HEAD of `main`. The installer now prints a clear WARNING when `version` is set to a semver or unrecognized value, making it obvious that the pin is not honored.
58+
- **Install script warns on volume-mount mismatch** — the Hermes config volume in `devcontainer.json` is pinned to `/home/vscode/.hermes`. If the feature's auto-detected user resolves to anything other than `vscode` (e.g. `node`, `codespace`, `root`), the installer now surfaces a WARNING that `hermes setup` state will not persist across rebuilds, instead of silently breaking.
5759

5860
### Configuration
5961

@@ -74,6 +76,17 @@ For minor and patch updates, you can usually just rebuild the container. Check t
7476
- **Install order guaranteed** — oh-my-claude added to `overrideFeatureInstallOrder` in devcontainer.json.
7577
- **Documentation** — added Known Limitations section covering expected `omc doctor` failures, missing slash commands (upstream issue), and role agent filtering.
7678

79+
### Agent Browser
80+
81+
- **Version bumped to latest** — updated from pinned 0.11.1; picks up `--auto-connect` fixes and CDP improvements through v0.26.0
82+
- **Host Chrome CDP documentation overhauled** — corrected Chrome version requirements (136+ needs `--user-data-dir`, 144+ has `chrome://inspect` checkbox), documented `host.docker.internal` for container-to-host networking, fixed flag naming (`--auto-connect` not `--autoConnect`), added Windows PowerShell launch commands
83+
84+
### Documentation
85+
86+
- **New guide: Windows Networking** — comprehensive WSL 2 mirrored networking setup for Windows users; recommended approach for port forwarding, replacing `dbr` on Windows
87+
- **Cross-references added** — before-you-install, accessing-services, troubleshooting, and devcontainer-cli pages now link to the Windows networking guide
88+
- **Agent-browser CDP troubleshooting** — new troubleshooting section for host Chrome connection issues (localhost vs host.docker.internal, Chrome version requirements, port exposure)
89+
7790
## v2.2.1 — 2026-04-16
7891

7992
### Configuration

docs/src/content/docs/reference/troubleshooting.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,45 @@ Check:
144144
2. Your distro is using WSL 2, not WSL 1.
145145
3. Docker Desktop was restarted after settings changes.
146146

147+
## Agent-Browser Cannot Connect to Host Chrome
148+
149+
Symptom: `agent-browser connect` fails with connection refused, timeout, or empty response.
150+
151+
Check these in order:
152+
153+
1. **Are you using `host.docker.internal`?** Inside a container, `localhost` refers to the container itself. Use `host.docker.internal:9222` to reach the host.
154+
155+
2. **Is Chrome remote debugging actually enabled?**
156+
- Chrome 144+: Open `chrome://inspect/#remote-debugging` and check that "Enable remote debugging" is checked.
157+
- Chrome 136–143: Chrome must be launched with both `--remote-debugging-port=9222` **and** `--user-data-dir`. Chrome 136+ silently ignores the port flag without a user data directory.
158+
- Verify from the host: `curl http://localhost:9222/json/version` should return JSON.
159+
160+
3. **Is the port reachable from the container?**
161+
```bash
162+
curl http://host.docker.internal:9222/json/version
163+
```
164+
If this fails, the host is not reachable. Windows users should enable [mirrored networking](/start-here/windows-networking/).
165+
166+
4. **Is another Chrome instance blocking the port?** Only one Chrome process can listen on a given debug port. Close other Chrome instances or use a different port.
167+
168+
5. **Firewall blocking?** Windows Firewall may block incoming connections on port 9222. Add an inbound rule or temporarily disable the firewall to test.
169+
170+
## Mirrored Networking Not Working
171+
172+
Symptom: After enabling mirrored networking in `.wslconfig`, ports are still not accessible between host and container.
173+
174+
Check these in order:
175+
176+
1. **Did you restart WSL?** Changes to `.wslconfig` require `wsl --shutdown` from PowerShell, then restarting your WSL distribution or Docker Desktop.
177+
178+
2. **Is mirrored mode actually active?** Run `wsl --status` from PowerShell and look for "Networking mode: Mirrored".
179+
180+
3. **VPN conflict?** Cisco AnyConnect and some VPN clients break mirrored networking. Disconnect the VPN and test again. See the [Windows Networking guide](/start-here/windows-networking/#vpn-conflicts) for workarounds.
181+
182+
4. **Windows update regression?** Microsoft occasionally ships updates that break mirrored mode. Check [WSL GitHub Issues](https://github.com/microsoft/WSL/issues) for known regressions. Revert to NAT mode as a temporary workaround.
183+
184+
5. **Docker Desktop version?** Mirrored networking requires Docker Desktop 4.26.0 or later. Update Docker Desktop if you're on an older version.
185+
147186
## Reset Options
148187

149188
Use the smallest reset that solves the problem:

docs/src/content/docs/start-here/before-you-install.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ CodeForge installs Claude Code inside the container, but you still need valid Cl
5858

5959
Windows users need **WSL 2**. Docker Desktop's legacy Hyper-V path is not supported for this workflow.
6060

61+
:::tip[Recommended: Enable mirrored networking]
62+
For the best experience on Windows, enable WSL 2 mirrored networking. It provides seamless port forwarding between your container and host — required for [host Chrome CDP connections](/start-here/windows-networking/#chrome-remote-debugging-setup) and eliminates the need for manual port forwarding tools.
63+
64+
See the [Windows Networking guide](/start-here/windows-networking/) for setup instructions.
65+
:::
66+
6167
## Hardware Guidance
6268

6369
| Resource | Minimum | Recommended |

0 commit comments

Comments
 (0)