Skip to content

[STG-1940] feat: add browser-swarm extension bridge POC#100

Open
shrey150 wants to merge 1 commit intomainfrom
shrey/browser-swarm-extension-bridge
Open

[STG-1940] feat: add browser-swarm extension bridge POC#100
shrey150 wants to merge 1 commit intomainfrom
shrey/browser-swarm-extension-bridge

Conversation

@shrey150
Copy link
Copy Markdown
Contributor

@shrey150 shrey150 commented May 7, 2026

Summary

  • add a browser-swarm skill with a Chrome extension bridge and localhost relay
  • create a colored browser-swarm tab group and target-bound CDP endpoints for each worker tab
  • document the POC workflow and why browse --target is not strictly required for this derisking pass

Linear: https://linear.app/browserbase/issue/STG-1940/add-browser-swarm-extension-bridge-poc

Verification

  • npm install && npm run e2e from skills/browser-swarm → PASS
  • node --check for extension service worker and relay/launcher/e2e scripts → PASS
  • JSON parse check for marketplace, manifest, package, package-lock → PASS

Artifacts 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.png

Note: root npm run build currently fails on origin/main as well because tsconfig.json has no TypeScript inputs. This PR does not touch that path.


Note

Medium Risk
Adds a new local Chrome extension (with debugger permission) 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-swarm skill 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 via chrome.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 an e2e POC runner, and registers/docs the new skill in marketplace.json and README.md.

Reviewed by Cursor Bugbot for commit 7ff085f. Bugbot is set up for automated code reviews on this repo. Configure here.

@shrey150 shrey150 marked this pull request as ready for review May 7, 2026 08:20
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7ff085f. Configure here.

}
});
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7ff085f. Configure here.

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