browser-integrations: Browserbase on Runloop example (Python + TypeScript)#21
browser-integrations: Browserbase on Runloop example (Python + TypeScript)#21vadim-rl wants to merge 2 commits into
Conversation
…peScript) Runnable companion to the "Browserbase on Runloop" docs tutorial. A research crawl in both languages: an agent in a Runloop devbox drives one Browserbase cloud browser by connecting Playwright over CDP to the session connect URL, so no Chromium runs in the devbox. Mirrors the structure of browser-integrations/kernel (package + main.py for Python; src/ + package.json for TypeScript). Verified against the installed SDKs (runloop_api_client, browserbase, playwright, @runloop/api-client, @browserbasehq/sdk); ruff + tsc clean; the identical reference was run live end to end (blueprint build, devbox provision, 72-page crawl, screenshots).
fc514a6 to
0ae92b9
Compare
|
Live verification now passes with the updated Browserbase project ID, but I found one setup-path issue worth fixing before merge. First-time The code only reuses Refs: |
… in-progress builds First-run `create-blueprint` could raise PollingTimeout while the blueprint was still building, and a rerun could start a duplicate build, because the code only reused `build_complete` blueprints and created fresh with the SDK default polling window. It now reuses a finished blueprint, waits for one that is still building instead of failing or duplicating, and uses a generous polling window for both the create and the wait. Applies to the Python and TypeScript examples. Addresses Tony's review on #21. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks Tony, good catch. Fixed in 4ce7fcf. create-blueprint now reuses a finished blueprint, and if one is still building it waits for that build (await_build_complete / awaitBuildComplete) instead of failing or starting a duplicate. Both the create and the wait use a generous polling window (900s, 10k attempts), so a slow first build no longer raises PollingTimeout. Applied to both the Python and TypeScript examples; tests and tsc pass. |
Browserbase on Runloop: Cloud Browsers for Devbox Agents
Adds a runnable
browser-integrations/browserbaseexample, the companion to the Browserbase on Runloop docs tutorial (docs PR forthcoming).Key architectural choice
The browser runs on Browserbase, not in the devbox. The agent runs in a Runloop devbox and connects a Playwright client over CDP to the session's
connect_url, so there is no Chromium and noplaywright installin the devbox, only thebrowserbaseSDK + the Playwright client.What's here
A research crawl (
run) in both languages: an agent in a devbox drives one Browserbase browser to scan seed sites and bring back structured data plus per-seed screenshots.python/:python main.py {create-blueprint | run}(abrowserbase_runlooppackage +main.py)typescript/:npm run {create-blueprint | run-browserbase}(TS orchestrator; the in-devbox agent is Python, embedded insrc/config.ts)Verification
runloop_api_client,browserbase,playwright,@runloop/api-client, and@browserbasehq/sdk.ruffclean;tscclean.