[STG-1940] feat: add browser-swarm extension bridge POC#100
[STG-1940] feat: add browser-swarm extension bridge POC#100
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7ff085f. Configure here.
| if (!opts.targetId) throw new Error("screenshot requires --target-id"); | ||
| const result = await post("/swarm/screenshot", { targetId: opts.targetId }, port, host); | ||
| print(result, opts.json); | ||
| return; |
There was a problem hiding this comment.
CLI --path option parsed but never used
Medium Severity
The --path option is documented in the usage() help text for the screenshot command and parsed into opts.path, but the screenshot handler never reads opts.path. The base64 screenshot data is just printed to stdout via print(). A user following the documented usage (screenshot --target-id <id> --path <file>) would expect the screenshot saved to disk, but it silently discards the path.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 7ff085f. Configure here.
| } | ||
| }); | ||
| } | ||
| } |
There was a problem hiding this comment.
Success response sent before potentially-throwing synthetic events
Low Severity
In handleCdpMessage, the success response is sent to the CDP client at line 361, and then emitSyntheticEvents is called at line 363 — both inside the same try block. If emitSyntheticEvents throws (e.g., findTarget at line 470), the catch block sends a second error response with the same request id. A CDP client receiving two responses for one id would enter an inconsistent state.
Reviewed by Cursor Bugbot for commit 7ff085f. Configure here.


Summary
browser-swarmskill with a Chrome extension bridge and localhost relaybrowser-swarmtab group and target-bound CDP endpoints for each worker tabbrowse --targetis not strictly required for this derisking passLinear: https://linear.app/browserbase/issue/STG-1940/add-browser-swarm-extension-bridge-poc
Verification
npm install && npm run e2efromskills/browser-swarm→ PASSnode --checkfor extension service worker and relay/launcher/e2e scripts → PASSArtifacts from the real e2e run:
/tmp/browser-swarm-e2e/report.json/tmp/browser-swarm-e2e/flights.png/tmp/browser-swarm-e2e/rentals.png/tmp/browser-swarm-e2e/dinner.pngNote: root
npm run buildcurrently fails onorigin/mainas well becausetsconfig.jsonhas no TypeScript inputs. This PR does not touch that path.Note
Medium Risk
Adds a new local Chrome extension (with
debuggerpermission) plus a WebSocket/HTTP relay that proxies CDP commands, so mistakes could impact local browsing sessions and stability despite being localhost-scoped.Overview
Introduces a new
browser-swarmskill that coordinates multiple agent workstreams against a single real Chrome profile by creating/maintaining a named colored tab group and exposing one target-scoped CDP WebSocket endpoint per tab.Adds a Manifest V3 extension (
skills/browser-swarm/extension) that attaches to tabs viachrome.debugger, manages tab/group lifecycle, and forwards CDP commands/events over a localhost WebSocket to a new relay CLI/server (scripts/swarm-relay.mjs). Includes helper scripts to launch Chrome with the extension and ane2ePOC runner, and registers/docs the new skill inmarketplace.jsonandREADME.md.Reviewed by Cursor Bugbot for commit 7ff085f. Bugbot is set up for automated code reviews on this repo. Configure here.