Repository navigation
feat(env): name the website browser Playwright MCP, let a run choose its browser, and set the default infra env ids in config.toml - #398
Conversation
…its browser, and set the default infra env ids in config.toml The env a deploy with websites adds is now playwright-mcp, after the server it runs, Microsoft's Playwright MCP: its id, environment_name, image (agentenv-playwright-mcp), folder, put and CLI. "Website browser" stays the slot's name: default_website_browser_env_id and the bootstrap kind. A run's user_overrides can name its browser (website_browser_env_id), like the gateway's and service-db's, read by the VM deploy and the snapshot reload, and set by task run --website-browser-env-id; env deploy takes --website-browser. [envs] default_gateway_env_id, default_service_db_env_id and default_website_browser_env_id are config.toml keys: an id set in code beats the file, which beats the built-in id. The attributes read as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| default_gateway_env_id = _DefaultEnvId() | ||
| default_service_db_env_id = _DefaultEnvId() | ||
| default_website_browser_env_id = _DefaultEnvId() |
There was a problem hiding this comment.
Existing config construction fails
Replacing these dataclass fields with unannotated descriptors removes their constructor arguments. Existing calls such as Config(default_gateway_env_id="candidate") now raise TypeError before the caller can use the config. The same break affects default_service_db_env_id and default_website_browser_env_id, and Config remains publicly exported.
Preserve these constructor arguments while adding file-backed reads, and add a test for each one.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/config/runtime.py
Line: 238-240
Comment:
**Existing config construction fails**
Replacing these dataclass fields with unannotated descriptors removes their constructor arguments. Existing calls such as `Config(default_gateway_env_id="candidate")` now raise `TypeError` before the caller can use the config. The same break affects `default_service_db_env_id` and `default_website_browser_env_id`, and `Config` remains publicly exported.
Preserve these constructor arguments while adding file-backed reads, and add a test for each one.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in the latest commit. The three ids are dataclass fields again, typed through the same descriptor, so Config(default_gateway_env_id=...) and the other two are accepted as before. A value passed in counts as an id set in code, and None leaves the [envs] key or the built-in id in effect. A new test covers each argument, both beating the config.toml key and passing None.
It's an MCP server env, so `agent-env env mcp-server put` writes it. A store that isn't local and lacks it now gets a hint naming that command over the image this install's release publishes (--image-ref), or the shipped Dockerfile when there is none. put_playwright_mcp_env stays for local stores' setup and AgentEnvHub's promotion. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…uments They're dataclass fields again, typed through the same descriptor, so Config(default_gateway_env_id=...) and the other two work as before: a value passed in is the id set in code, and None leaves the config.toml key or the built-in id in effect. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rvices of one name when rendering The reserved names are the services every gateway deploy runs (gateway, servicedb, pgweb, db-mcp). The website browser a deploy adds can be named anything: rendering the compose file refuses two of a deploy's services sharing a name, which catches an env named like whichever browser the deploy got, and an env named like one of the reserved services. A website's services are suffixed, so a website may still share an MCP server's name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…its own for any other A slot naming a browser agent-env doesn't ship, say browseruse-mcp, used to get the Playwright image built under that id in local stores, and a hint to put the Playwright image under it in others. Now agent-env sets up the website browser only under playwright-mcp, the id of the one it ships. A missing env under any other id is refused before anything is built, with a generic mcp-server put hint that shows the shipped browser's values as the example. An env that exists under any id is left as it is. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Summary
The website browser gets a name of its own, Playwright MCP, and which browser a deploy gets becomes something a run or a config file can choose.
playwright-mcp, after the server it runs, Microsoft's Playwright MCP (@playwright/mcp).environment_name, and so its compose service, Postgres schema, card and gateway path (/svc/mcp-playwright-mcp/…) all change.ghcr.io/scaleapi/agentenv-playwright-mcp, folderenv/envs/playwright_mcp/,put_playwright_mcp_env, constantsPLAYWRIGHT_MCP_*.default_website_browser_env_id, and the bootstrap kindwebsite-browser.browser_navigateand the rest, since their names come from the image.website_browser_env_id, like the gateway's and service-db's (feat(task): a run's gateway and service-db env overrides travel with it to any runner #255).run_env_idsand awebsite_browser_env_id(config)getter, which both deploy readers use: the VM deploy and the snapshot reload.agent-env task run --website-browser-env-idsets it, andagent-env env deploy --website-browsersets the default.task rundoesn't set up the browser in local stores when the run names its own.[envs]keys in config.toml for the three default infra env ids:default_gateway_env_id,default_service_db_env_idanddefault_website_browser_env_id.RESOLVED_KEYSlike[agents] default_a2a_agent_id: an id set in code, byconfigure(...)or the attribute, beats the file, which beats the built-in id.Configconstructor arguments and attributes, soConfig(default_gateway_env_id=...)and code readingconfig.default_gateway_env_idkeep working.AGENTS.mdand.agentenv/config.example.toml.agent-env env website-browser putgoes, with no replacement. The browser is an ordinary MCP server env, soagent-env env mcp-server putwrites it.agent-env env mcp-server put --id playwright-mcp --environment-name playwright-mcp --image-ref ghcr.io/scaleapi/agentenv-playwright-mcp:src-….It names the shipped Dockerfile instead when the release published none.
put_playwright_mcp_envstays, for local stores' setup and AgentEnvHub's promotion.playwright-mcp, the id of the one it ships. A slot naming another browser the store lacks is refused, in local stores too, with a genericmcp-server puthint that shows the shipped browser's values as the example. An env that exists under any id is left alone.env website-browserandenv playwright-mcpfrom coming back.Why
AgentEnvHub will promote the browser from agentenv-framework pin bumps, the way it promotes the gateway and service-db. It checks each release's browser under a candidate env through this override before serving it (FD-4648). There's more than one website browser too: synthetic-pipelines has its own Playwright-based one, and a browser-use one is likely. So each is named after its source, and the slot says which one a deploy gets.
Upgrading
playwright-mcp. Put it first withagent-env env mcp-server putas above, or keep the old env with[envs] default_website_browser_env_id = "website-browser". AgentEnvHub's dev and prod stores already holdplaywright-mcpv1, a copy of what each serves today.playwright-mcpon the first run that needs it. A slot naming another browser needs that env put first.start_computer_recordingthat namesenvironment_name: "website-browser"should nameplaywright-mcponce the browser it records runs the renamed image.Testing
tst/unit/agents/hermes/test_hermes_bridge.py::test_the_event_pipe_is_not_left_open_in_the_server, which reads/proc/self/fd; macOS doesn't have it, and this PR doesn't touch that code.[envs]layer, andconfigure();task runflag;task runnot setting up the browser when a run names its own;test_gateway_with_single_website_envandtest_gateway_with_multi_env_including_website, can't run on an arm64 Mac: the test builds the browser for linux/amd64, and Chromium crashes at launch under qemu (qemu: uncaught target signal 6, after the GPU process fails). CI runs them natively.playwright-mcpv1 is the copy ofwebsite-browserthat the bot's pin will first meet. On Modal VM:gate-website, the framework's test site: the browser listed its tools, navigated, and read "Slack Workspace".psi-stayncook-multi, a real multi env: 43 tools, and the browser read its site's title.src-33deb10f…, which prod serves, so the release republishes no gateway. The browser becomesagentenv-playwright-mcp:src-347ea6d9….playwright-mcpwithcomputer-recording/v1;🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the earlier constructor break is fixed and no new blocking issues were found.Summary
The PR names the shipped browser
playwright-mcp, adds browser choices for individual runs, and lets config files set the default infra env IDs.playwright-mcp.Reviews (5) · Last reviewed commit: "fix(env): set up only the website browse..." · Reviewed by Greptile