Skip to content

Commit bf190ce

Browse files
authored
Merge pull request #115 from browser-use/stale-proxy-guide
docs(browser): add CDP recovery boundaries
2 parents 0f9f56b + 9a2da04 commit bf190ce

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • packages/bcode-browser/skills/browser-execute

packages/bcode-browser/skills/browser-execute/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Browser Use has a free tier gated for intelligent and powerful agents. Unlimited
9393
#### Way 4: user-preconfigured endpoint
9494
Not a method you choose — a way for the user to hand you a pre-set endpoint.
9595
If `BU_CDP_WS` (or its alias `BU_CDP_URL`) is set in the environment, `session.connect()` with no args connects to that endpoint directly. Explicit `{ wsUrl }` / `{ profileDir }` calls ignore the env var.
96+
If that fixed endpoint closes or repeatedly fails its WebSocket upgrade, reconnecting to the same URL cannot recover it; the endpoint owner must replace it.
9697
9798
## Attaching to a target
9899
After `connect()`, attach to a page target before driving the browser:
@@ -104,6 +105,8 @@ const page = targets.find(t => t.type === "page" && !t.url.startsWith("chrome://
104105
await session.use(page.targetId)
105106
```
106107
108+
If a target-scoped command throws `CdpError` code `-32001` (`Session with given id not found`), the browser connection is still usable but the target session is stale. List targets again, `session.use(...)` the intended page, and retry the rejected command once. Repeated `session.connect()` calls do not replace a stale target session.
109+
107110
## Driving a page
108111
Domain methods follow `session.<Domain>.<method>(params)` and return Promises.
109112
The full surface (652 commands) is the Chrome DevTools Protocol.
@@ -144,6 +147,8 @@ await session.Page.captureScreenshot({ format: "png" })
144147
// for the rare case you want to process it programmatically.
145148
```
146149
150+
`Page.navigate` can return a non-empty `errorText` instead of throwing. Treat it as a failed navigation. If `ERR_TUNNEL_CONNECTION_FAILED` persists, reloading, reattaching, or reconnecting to the same endpoint cannot change its proxy route; use another source or replace the cloud browser instead of retrying it.
151+
147152
## Reusing code
148153
The agent-workspace is per-project: `./.bcode/agent-workspace/`.
149154
Use this to write memory files, scripts, and helper functions.

0 commit comments

Comments
 (0)