Conversation
|
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
packages/multiagentworkspace package andmultiagentCLI for running one or more agent harnesses against shared browser and MCP tool configurationsWhat's in this PR
packages/multiagentpackage withBrowserSession,MCPServer,AgentSession, andMultiAgentDrivermultiagent runand the package's internal stdio MCP server modeagent-browserharness rejection with a clear error because upstream is a browser runtime/CLI rather than an LLM harness loopchrome-devtools-mcp,playwright-mcp,agent-browser-mcp, Browser Use MCP, Stagehand agent tools, and Understudy toolsArchitecture
This package is intentionally split into a few small state-owning services rather than one large runner:
BrowserSessionowns the connected browser instance, whether that means attaching to an existing CDP URL or launching local ChromiumMCPServerowns one tool server at a time, including process lifecycle, tool discovery, and direct tool calls for internal adaptersAgentSessionowns per-harness invocation state, message history, and the set of attached MCP servers exposed to that harnessMultiAgentDrivercomposes those services, fans the task out across one or more configured harnesses, and collects per-agent resultsThat split keeps browser state, tool state, and harness state isolated so we can add more harnesses/toolsets without turning the runtime into shared mutable state.
Supported surface in this PR
Harnesses
claude-codecodexgemini-cliopencodebrowser-usestagehandagent-browseris intentionally treated as unsupported as a harness and returns a descriptive errorToolsets
playwrightchrome-devtoolsagent-browserbrowser-usestagehand-agentunderstudyBrowser modes
cdpUrl: attach to an existing browser over CDPcdpUrl: launch local Chromium with Puppeteer, then attach the loops/tools over CDPVerification
Passing
pnpm --filter @browserbasehq/multiagent run testFailing on current
mainbaseline outside this diffpnpm --filter @browserbasehq/multiagent run typecheckpnpm --filter @browserbasehq/multiagent run buildBoth currently fail because
packages/core/lib/v3/launch/browserbase.tsno longer satisfiesSessionCreateParamsonmain(projectIdis now required there). This PR does not touch that code path.Smoke coverage performed while building the package
opencode + playwright + local Chromiumagainstexample.combrowser-use + local Chromiumagainstexample.comgemini-clipath verifying that missing auth is surfaced cleanly through the driveragent-browserpath verifying the intentional explanatory unsupported-harness errorNotes
multiagent-driverontomainbefore opening this PR so the diff is isolated to the multiagent package instead of inheriting the unrelatedserver-v4-understudy-routeshistory.packages/multiagent/README.mdis intended to stay current with support/config/runtime changes and documents the architecture in detail.Summary by cubic
Adds the
@browserbasehq/multiagentpackage andmultiagentCLI to run one or more agent harnesses against a shared browser session and MCP tool servers. The runtime is split into isolated actors for browser, tools, and per-agent sessions with a driver orchestrator.New Features
multiagent runandmultiagent mcp-server <stagehand-agent|understudy>.BrowserSession,MCPServer,AgentSession,MultiAgentDriver.claude-code,codex,gemini-cli,opencode,browser-use,stagehand.playwright,chrome-devtools,agent-browser,browser-use,stagehand-agent,understudy.cdpUrlor launch local Chromium viapuppeteer-coreand reconnect over CDP.Dependencies
@modelcontextprotocol/sdk,@playwright/mcp,chrome-devtools-mcp,agent-browser,agent-browser-mcp,puppeteer-core(seepnpm-lock.yaml).Written for commit 63941e8. Summary will update on new commits. Review in cubic