Skip to content

feat(examples): browser tool example with internal hostnames - #2674

Merged
ben-reitz merged 11 commits into
browser-internal-hosts/docsfrom
browser-internal-hosts/example
Oct 27, 2026
Merged

ben-reitz merged 11 commits into
browser-internal-hosts/docsfrom
browser-internal-hosts/example

Conversation

@ben-reitz

@ben-reitz ben-reitz commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

👉🏼 Deployed version of the demo here 👈🏼

New example at examples/next/tools/browser: a Pi-harness agent with a Computer workspace in a Container and a persistent browser with three internal hosts.

BrowserAgent (Pi harness)
├── workspace   @cloudflare/computer Workspace, exec in a Container (npm, dev server)
├── browser     Browser Run, allowedDomains: [], internal hosts:
│   ├── docs.internal     worker: DocsSite        # the agent's build instructions
│   ├── preview.internal  target { port }         # dev server in the container
│   └── files.internal    target { folder }       # static build from the workspace
└── tools       workspace tools + browserTool
UI: chat, Live View panel with each host's target, "How it works" dialog walking through the code

Uses Workers AI @cf/zai-org/glm-5.3-flash (image input, so screenshots reach the model).

@ben-reitz
ben-reitz added this pull request to stack #2675 October 22, 2026 15:10
@ben-reitz ben-reitz changed the title browser internal hosts/example feat(examples): browser tool example with internal hostnames Oct 22, 2026
@agent-think

agent-think Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (76abe6e4 → 9e81eecb, workflow run)

@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from c90d854 to b444fb8 Compare October 22, 2026 15:40
@changeset-bot

changeset-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9e81eec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from b444fb8 to f2ee8fc Compare October 22, 2026 23:08
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch 3 times, most recently from 512eb4c to 017c05f Compare October 23, 2026 10:52
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from 017c05f to 7cd77a8 Compare October 23, 2026 12:29
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch 3 times, most recently from 24bfe6f to cb0bd29 Compare October 23, 2026 13:26
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from cb0bd29 to 83ba20d Compare October 23, 2026 13:34
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from 83ba20d to daef8af Compare October 23, 2026 13:59
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch 2 times, most recently from 10f54d6 to 5491de8 Compare October 26, 2026 10:32
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from 5491de8 to 0cc2767 Compare October 26, 2026 10:39
@ben-reitz
ben-reitz marked this pull request as ready for review October 26, 2026 13:58
devin-ai-integration[bot]

This comment was marked as resolved.

@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from 096a503 to 588f814 Compare October 26, 2026 14:21
@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@2674

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@2674

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@2674

hono-agents

npm i https://pkg.pr.new/hono-agents@2674

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@2674

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@2674

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@2674

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@2674

commit: c901fd3

@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from c033058 to 113fd5c Compare October 26, 2026 16:44
@ben-reitz
ben-reitz removed this pull request from stack #2675 October 26, 2026 16:47
@ben-reitz
ben-reitz added this pull request to stack #2723 October 26, 2026 16:47
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch 2 times, most recently from 0e6437d to 7057906 Compare October 26, 2026 17:04
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch 4 times, most recently from c901fd3 to 586ef9e Compare October 27, 2026 10:31
A pi agent with a container workspace and a persistent Browser Run browser that opens its dev server (preview.internal), a workspace folder (files.internal), and a docs Worker entrypoint (docs.internal).
Derive the panel's state during render and chain its fetch, as #2715 did
for the other examples, and take the pi example's use-pi-session again.
…Live View on refresh

Chrome sends no Sec-Fetch-* headers to an http host, so spot a page load
by its Accept header. Refresh drops the pinned Live View URL, since an
old one can't connect again.
pi-durable 1.2 renamed a tool result's content to output, so with the
example on pi ~1.4 every workspace tool came back empty, as #2594 fixed
for the pi example.
@ben-reitz
ben-reitz force-pushed the browser-internal-hosts/example branch from 586ef9e to 9e81eec Compare October 27, 2026 10:39
@ben-reitz
ben-reitz merged commit fd3317d into main Oct 27, 2026
7 checks passed
@ben-reitz
ben-reitz deleted the browser-internal-hosts/example branch October 27, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant