Repository navigation
browser: run createBrowserTool without codemode, on a BrowserSession - #2612
Closed
mattzcarey wants to merge 1 commit into
Closed
mattzcarey wants to merge 1 commit into
mattzcarey wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 4e1e7cc The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
🔴 agents import sizes: 1 entry point over threshold
Changed exports (11)
How this worksEach runtime export is bundled on its own, minified, and gzipped. Changes smaller than 100 B, or smaller than 1% and 1 KiB, are ignored. Growth over 10% or 5 KiB is marked 🔴. This report is informational and does not fail CI. The workflow artifact contains every measurement. Compared |
This was referenced Oct 19, 2026
mattzcarey
force-pushed
the
browser-session
branch
from
October 19, 2026 14:01
f4ea1a7 to
3ec1c1c
Compare
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
mattzcarey
force-pushed
the
browser-session
branch
from
October 19, 2026 17:06
3ec1c1c to
4e1e7cc
Compare
ben-reitz
added a commit
that referenced
this pull request
Oct 26, 2026
…2667) * feat(browser): run browserTool on a BrowserSession, without codemode browserTool's code now runs in a fresh Dynamic Worker from `loader` (browser/sandbox.ts) with no network access and a frozen `cdp` object as its only way out, instead of on a codemode facet. It no longer needs `ctx` (now ignored) or a `CodemodeRuntime` export, and its output drops the `calls` log. The per-run CDP logic moves from session-connector.ts into BrowserSession (browser/session.ts), returned by `browser.session()`: the "active" tab, attach handles, error hints, refusing Browser.close, and the end-of-run report. truncate.ts is a copy of codemode's truncateResult. BrowserConnector is marked deprecated. Ported from #2612, keeping the browserTool name. Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * fix(browser): address review on browserTool without codemode - Statements with no return get a notice instead of a silent undefined. - Rule and docs say only screenshots over 1 MB fail, and why the limit stays. - Pi docs drop the CodemodeRuntime export. - Design record: browserTool first, codemode connector under Deprecated. Co-authored-by: Matt Carey <77928207+mattzcarey@users.noreply.github.com> * docs(browser): move deprecated browser docs to the bottom, notice on every empty body run A `return` inside a string no longer hides the statements notice. Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * docs(browser): rewrite browserTool's How It Works in the design doc Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * docs(browser): rewrite Browse the Web around browserTool, slim the deprecated part Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * docs(browser): lead with pi, drop Experimental from Browse the Web Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * docs(browser): no contractions in Browse the Web Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * docs(browser): say browserTool still needs @cloudflare/codemode installed Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * fix(browser): refuse Live View, handoff and tunnelling CDP commands Model code could mint a Live View link with Cloudflare.getLiveView, or wrap a refused command in Target.sendMessageToTarget. Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * fix(browser): a host-side deadline for browserTool runs Model code could cancel the sandbox's timer and hold the scope's queue. Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * fix(browser): keep only real screenshots whole A returned browser_screenshot must be a png, jpeg or webp of base64 data within the 1 MB limit; anything else is cut down like any other result. Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * fix(browser): run an arrow function that ends in a semicolon and comment Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * fix(browser): bound browserTool's console logs Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * docs(agents): browser rows in AGENTS.md mark the deprecated codemode APIs * chore(browser): the browserTool changeset says to keep codemode installed Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> * fix(browser): cut a huge thrown error down like a result Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com> --------- Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com>
Contributor
|
All done in #2667 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
createBrowserToolnow runs the model's code in a fresh Dynamic Worker from theloaderyou pass, with no network access and acdpobject backed by the newbrowser.session(). It no longer runs on@cloudflare/codemode, so it needs neitherctxnor aCodemodeRuntimeexport.Stacked on #2610, as part of deprecating codemode (#2609):
BrowserSessionholds the CDP logic that used to live inBrowserSessionConnector: the"active"tab, attach handles, error hints and the report.@cloudflare/computer'sws:browser(computer: Add a ws:browser host module computer#248) uses it throughnameandsession()instead of its own copy, so neither package imports the otheracornnormalizer for this toolBrowserConnector, its option types andCodemodeRuntimeare still exported fromagents/browser(now marked deprecated), soagents/browserstill imports codemode until they're removedpnpm run check, theagentsworkers suite, the pi harness suite and the real-Chrome suite (test:browser) ran.browser-session.test.tsports the connector's tests, and new tests cover the code shapes, parse errors, thrown errors, logs, timeouts and blockedfetch.