You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decision: mount Playwright MCP in agent turns, or drop it from the sandbox image? #4730
The sandbox image installs @playwright/mcp with its browser (services/sandbox-runtime/Dockerfile:328-378). The exec builder mounts it only when a turn's spec sets mcp.browser (services/platform/lib/harnesses/exec-builder.ts:494-507,654-660), and no production caller sets it: services/platform/backend/core/chat/external_turn_shared.ts:475-477 passes mcp: { bridgeUrl } only, and browser: 'headless' appears only in test helpers. So no production agent turn ever gets the browser tools — while services/sandbox-runtime/README.md:142-148 says every managed agent turn lists the Playwright MCP server. Verified on main at 73d03a9.
One dependency to keep in mind: render_fetch.ts resolves playwright-core from inside the MCP package first (services/platform/backend/core/node_only/sandbox/render_fetch.ts:497-501).
Options
Mount it — set mcp.browser: 'headless' for managed turns (the lazy launcher keeps turns that never open a browser cheap), so agents can test the web apps they build.
Drop it — remove @playwright/mcp from the image (~120 MB), keep a standalone playwright-core for render_fetch, and correct the README.
Mount it.buildExternalTurnExec (external_turn_shared.ts), the one builder every production harness turn goes through (tasks, automations, and chat through its task handover), sets mcp.browser: 'headless' on every turn whose harness declares capabilities.mcp: true. That applies on both the gateway lane and the subscription lane. The connectors bridge keeps being mounted as it is today. Hermes and Cursor (capabilities.mcp: false) get no browser. @playwright/mcp and its Chromium stay in the sandbox image, and render_fetch keeps resolving playwright-core the way it does now.
Answers
Mount or drop? Mount.
Gateway turns only? No. Subscription turns get it too. The browser carries no credential, and every turn runs in the same isolated sandbox with filtered egress.
render_fetch's dependency? Unchanged.
README? Yes. It must state the exact rule (every turn on a harness that mounts MCP servers, not Hermes or Cursor), and a builder test enforces it.
Rationale
Everything except the final wiring already exists: the proxy-aware launcher, the lazy launcher (a turn that never opens a browser starts no server), the recorded argument manifests, the vision-polyfill arguments and the localhost-testing flags. No caller ever set mcp.browser, and that is the whole gap. Dropping the package saves far less than 120 MB, because render_fetch and the visual-aspect-analyzer skill still need Chromium and playwright-core. The browser runs inside the locked-down session container through the egress filter and holds no credential, so mounting it adds no exposure.
Implementation units
feat(platform): mount Playwright MCP on every MCP-capable turn (base: main, S).
Builder change, with tests on both serving lanes, with and without a bridge.
Hermes and Cursor carry no browser.
Vision-polyfill arguments on claude-code; plain arguments on codex.
Correct services/sandbox-runtime/README.md.
test(sandbox): real-sandbox integration test (base: main, M, after unit 1).
The lazy tools/list is answered without starting the server.
browser_navigate to a localhost server inside the sandbox succeeds.
Activity
yannickmonney commentedon Nov 14, 2026
Decision
Mount it.
buildExternalTurnExec(external_turn_shared.ts), the one builder every production harness turn goes through (tasks, automations, and chat through its task handover), setsmcp.browser: 'headless'on every turn whose harness declarescapabilities.mcp: true. That applies on both the gateway lane and the subscription lane. The connectors bridge keeps being mounted as it is today. Hermes and Cursor (capabilities.mcp: false) get no browser.@playwright/mcpand its Chromium stay in the sandbox image, andrender_fetchkeeps resolvingplaywright-corethe way it does now.Answers
render_fetch's dependency? Unchanged.Rationale
Everything except the final wiring already exists: the proxy-aware launcher, the lazy launcher (a turn that never opens a browser starts no server), the recorded argument manifests, the vision-polyfill arguments and the localhost-testing flags. No caller ever set
mcp.browser, and that is the whole gap. Dropping the package saves far less than 120 MB, becauserender_fetchand the visual-aspect-analyzer skill still need Chromium andplaywright-core. The browser runs inside the locked-down session container through the egress filter and holds no credential, so mounting it adds no exposure.Implementation units
feat(platform): mount Playwright MCP on every MCP-capable turn (base: main, S).services/sandbox-runtime/README.md.test(sandbox): real-sandbox integration test (base: main, M, after unit 1).tools/listis answered without starting the server.browser_navigateto a localhost server inside the sandbox succeeds.