Skip to content

Commit a9a0d62

Browse files
committed
docs(browser): clarify target recovery after timeout
1 parent fae4c11 commit a9a0d62

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ console.log(JSON.stringify(titles))
202202
## Guardrails
203203
- Top-level `import` statements inside the snippet body are not allowed. Use `await import(...)` instead.
204204
- No CPU-bound infinite loops without `await` — they ignore the timeout. Insert `await new Promise(r => setTimeout(r, 0))` to yield.
205-
- `browser_execute` defaults to 60s (max 600s); inner CDP timeouts do not extend it. Prefer the default and small batches: a longer timeout also delays your next chance to inspect or recover, so split multi-page loops into separate calls. After a timeout, the same CDP session and active target are preserved; inspect the current page state in the next call and reconnect only if the socket actually closed.
205+
- `browser_execute` defaults to 60s (max 600s); inner CDP timeouts do not extend it. Prefer the default and small batches: a longer timeout also delays your next chance to inspect or recover, so split multi-page loops into separate calls. After a timeout, the same CDP session and active target are preserved, but an already-sent command may still be running in Chrome. Try one small state check; if that target is unresponsive, attach a fresh page target instead of retrying longer, and reconnect only if the socket actually closed.
206206
207207
## Console
208208
- `console.log`, `console.error`, `console.warn`, `console.info`, `console.debug` are all captured and streamed to the user. Treat them as your stdout. Other `console.*` methods write to bcode's stderr without being captured into the tool result.

‎packages/bcode-browser/src/cdp/session.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ export class Session implements Transport {
9696
* and we connect directly to the supplied endpoint.
9797
*/
9898
async connect(opts: ConnectOptions = {}): Promise<void> {
99-
assertExecutionActive();
10099
if (this.invalidatedError) throw this.invalidatedError;
101100
const timeoutMs = opts.timeoutMs ?? 5_000;
102101
if (opts.wsUrl || opts.profileDir) {
@@ -284,7 +283,6 @@ export class Session implements Transport {
284283
opts: { predicate?: (params: T) => boolean; timeoutMs?: number } = {},
285284
...rest: never[]
286285
): Promise<T> {
287-
assertExecutionActive();
288286
// Both legacy positional shapes fail loudly rather than silently reverting
289287
// to the 30s default: `(method, predicate)` lands on the first guard,
290288
// `(method, predicate?, timeoutMs)` on the second. Snippets are written at

0 commit comments

Comments
 (0)