Skip to content

Commit 0817dd5

Browse files
author
bcode
committed
feat(fetch-use): default experimental.fetch_use to off
Eval runs showed fetch-use routing had no measurable impact on accuracy versus native HttpClient, while adding latency on every webfetch call. Flip the default so users must explicitly opt in via experimental.fetch_use=true in opencode.json. The feature itself is unchanged — only the default and accompanying docs/comments.
1 parent 74c2e2d commit 0817dd5

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

packages/bcode-browser/skills/BROWSER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ console.log("liveUrl for the user to watch:", liveUrl)
9898
9999
Requires `BROWSER_USE_API_KEY` in the environment (the user should have set this before launching bcode). If absent, tell the user to get a key at https://browser-use.com and `export BROWSER_USE_API_KEY=...`.
100100
101-
When `BROWSER_USE_API_KEY` is set, `webfetch` is automatically enhanced with `fetch-use` (Chrome TLS fingerprint + residential proxy + session cookies) — each request is free, but consumes a small amount of proxy bandwidth from the BU account. Disable in `opencode.json` with `experimental.fetch_use: false`.
101+
`webfetch` can be enhanced with `fetch-use` (Chrome TLS fingerprint + residential proxy + session cookies) when `BROWSER_USE_API_KEY` is set. Off by default — enable in `opencode.json` with `experimental.fetch_use: true`. Each request is free but consumes a small amount of proxy bandwidth from the BU account and adds latency vs. native HttpClient.
102102
103103
## Attaching to a target
104104

packages/bcode-browser/test/fetch-use.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Unit: layer is constructible, `enabled` reflects BROWSER_USE_API_KEY presence.
44
// Live: when the key is set, end-to-end POST to fetch.browser-use.com returns
55
// body bytes + content-type. Skipped without the key. Config-based
6-
// opt-out (experimental.fetch_use=false) is enforced in webfetch.ts,
6+
// opt-in (experimental.fetch_use=true) is enforced in webfetch.ts,
77
// not here.
88

99
import { expect, test } from "bun:test"

packages/opencode/src/config/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export const Info = Schema.Struct({
265265
}),
266266
fetch_use: Schema.optional(Schema.Boolean).annotate({
267267
description:
268-
"Route webfetch through the Browser Use fetch-use proxy when BROWSER_USE_API_KEY is set. Defaults to true; set false to opt out (still costs but uses native HttpClient instead).",
268+
"Route webfetch through the Browser Use fetch-use proxy when BROWSER_USE_API_KEY is set. Defaults to false; set true to opt in (adds Chrome TLS fingerprint + residential proxy at the cost of extra latency).",
269269
}),
270270
}),
271271
),

packages/opencode/src/tool/webfetch.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ export const WebFetchTool = Tool.define(
5151

5252
const timeout = Math.min((params.timeout ?? DEFAULT_TIMEOUT / 1000) * 1000, MAX_TIMEOUT)
5353

54-
// BrowserCode: route through fetch-use when BROWSER_USE_API_KEY is
55-
// set and the user hasn't opted out via experimental.fetch_use=false.
56-
const useFu = fetchUse.enabled && (yield* config.get()).experimental?.fetch_use !== false
54+
// BrowserCode: route through fetch-use only when BROWSER_USE_API_KEY
55+
// is set AND the user has opted in via experimental.fetch_use=true.
56+
// Default is off: enabling adds latency without measurable accuracy gains.
57+
const useFu = fetchUse.enabled && (yield* config.get()).experimental?.fetch_use === true
5758
const { arrayBuffer, contentType } = yield* (useFu
5859
? fetchUse
5960
.fetch(params.url, { timeoutMs: timeout })

0 commit comments

Comments
 (0)