Repository navigation
feat(agents): add TanStack AI browserTool for a persistent browser - #2428
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: ad902a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 grew
Changed exports (2)
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 |
ben-reitz
marked this pull request as ready for review
October 1, 2026 13:18
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
| }); | ||
| ``` | ||
|
|
||
| The TanStack AI tool doesn't support screenshots yet. TanStack AI gives the host and the model the same output, so if the model returns a screenshot, the tool replaces it with a note saying it was left out, and the tool's instructions tell the model to read the page with `Runtime.evaluate` instead. |
Contributor
Merged
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.
TL;DR: Adds
browserTooltoagents/browser/tanstack-ai, the TanStack AI version of the persistent browser tool fromagents/browser/ai-sdk.What changed
browserTool(connector, codemode runtime, browser report) moved into an internalbrowser/browser-tool.ts. Bothai-sdk.tsandtanstack-ai.tsbuild on it, so they behave the same: active tab,newTabs,restarted/notice, runtime name.name(default"browser"). Returns aServerTool, and the name's type followsname.callslog and cappedlogs. Screenshots aren't supported yet: a returned screenshot is replaced by a note saying it was left out (restart notices andnewTabsstill come through), and the tool'scdphint tells the model to read the page withRuntime.evaluateinstead. Each adapter now supplies its own screenshot hint to the shared core, so the AI SDK tool keeps its "the UI keeps the image" wording.~standard.types(type-only), so TanStack AI types the input as{ code: string }without a cast.createBrowserToolsis still there and not deprecated.Tests
browser-capability.test.ts: tool name, reuse of the same persistent browser plus restart reporting, the screenshot note and hint, and the restart notice kept alongside the screenshot note.browser-tool.test-d.ts: it's aServerTool, and the name type followsname.Docs and changesets
docs/agents/browse-the-web.md, pluspackages/agents/AGENTS.md.agentspatch and@cloudflare/codemodepatch.