Add experimental browser CDP tools without a bundled spec#1163
Open
threepointone wants to merge 4 commits intomainfrom
Open
Add experimental browser CDP tools without a bundled spec#1163threepointone wants to merge 4 commits intomainfrom
threepointone wants to merge 4 commits intomainfrom
Conversation
Introduce experimental "Browse the Web" browser tools that expose Chrome DevTools Protocol (CDP) access (browser_search and browser_execute). Adds documentation, an examples/ai-chat integration (env types, wrangler config, start script, server & UI updates), a CDP spec build script (scripts/build-cdp-spec.ts) that generates spec data, new browser package exports and build targets, and end-to-end browser tests with Vitest. Also updates .gitignore and package metadata to include new optional dependencies and test scripts. This enables agents to run sandboxed JS that queries the CDP spec and executes CDP commands against a host browser for scraping, inspection, and debugging.
🦋 Changeset detectedLatest commit: 3163cda The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
jonnyparris
added a commit
to jonnyparris/dodo
that referenced
this pull request
Apr 8, 2026
Replace the single browser_navigate tool (text extraction only) with two code-mode tools that give sessions full CDP access: - browser_search: query the ~1.7MB CDP spec server-side (56 domains, 664 commands, 237 events). The spec never enters the context window. - browser_execute: run CDP commands against a live headless Chrome via WebSocket. Screenshots, DOM manipulation, network interception, etc. Uses Dodo's existing DynamicWorkerExecutor + BROWSER binding. The LLM writes JS that executes in a sandbox with a cdp helper (send, attachToTarget, getDebugLog). Adapted from cloudflare/agents#1163. Also: - Remove @cloudflare/puppeteer dependency (no longer needed) - Update system prompt with CDP usage patterns - Fix stale MCP catalog test (sentry entry was removed)
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.
Summary
wrangler dev, without a separate Chrome process.What Changed
browser_searchnow fetches the live protocol from the Browser Rendering devtools endpoints, normalizes it into the tool-facing search shape, and caches it briefly in memory.browser_executenow connects through the Browser Rendering devtools WebSocket endpoint and cleans up sessions with the correspondingDELETEendpoint.build-cdp-specbuild step.wrangler devinstance and exercise simple search and execution scenarios.ai-chatexample to use the Browser Rendering binding directly in local development.Testing
npm run test:browserWRANGLER_PACKAGE=wrangler@latest npm run test:browsernpm run -w agents buildNotes
4.81.1because the previous pin (4.77.0) did not support the local Browser Rendering devtools path used by these tests.CDP_BASE_URLor a separately managed Chrome process.docs/browse-the-web.mdanddesign/browser-tools.md.