Repository navigation
fix(env): give the website browser a network of its own and no database - #488
Merged
Merged
Conversation
The website browser shared env-network with every backing MCP server, website backend, the state store and its SQL consoles, so the agent could drive it to any of them by name and around the gateway. It now sits on website-network with the gateway and each site's frontend (the backend of a site that has none), and on nothing else. Composes without a website browser, such as the SDK's exports, render as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
force-pushed
the
edgararakelyan/website-browser-network
branch
from
November 9, 2026 17:30
e42997f to
1ea5a04
Compare
…rowser gets no database The website browser was marked with a website_browser flag that the compose renderer turned into network placement. MCPServerConfig now carries the networks a server joins, env-network by default, and the gateway puts the browser it adds on website-network alone. Only env-network reaches the env's database, so a server off it is no database client: it gets no schema, no DATABASE_URL and no wait on servicedb. The browser had all three and used none, and its URL carried the shared store's credentials. init-env-state leaves its schema out to match the deploy's prepare, and the local store takes its schema list from _all_environments instead of building its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Every env with a website gets the website browser added as one of its MCP servers. It runs Playwright with
--allowed-hosts '*'onenv-network, the compose network it shared with every backing MCP server, every site backend, the state store (servicedb) and its SQL consoles (pgweb, db-mcp). So the agent could drive it to any of them by name and around the gateway: a site backend's own API, a server's data plane, or SQL through pgweb. It also got a schema and aDATABASE_URLlike any MCP server, though it uses no database, and that URL carries the shared store's credentials.What changes
MCPServerConfiggainsnetworks, the compose networks its service joins,env-networkby default. The gateway puts the browser it adds for an env with websites onwebsite-networkalone.create_docker_composerenders each MCP server on itsnetworks, and addswebsite-networkwhen a server is on it. That network holds:env-networkas well. MCP servers, site backends,servicedb, pgweb and db-mcp stay onenv-networkonly.env-networkreaches the database, so a server off it is no database client: it gets no schema, noDATABASE_URLand no wait onservicedb. That leaves the browser out of the local store's schemas, the init script and a remote store'sprepare.agent-env env init-env-stateleaves it out too, to keep matching the deploy.create_docker_composewith their own server list and keep the default network.Synthetic site frontends proxy
/apiand/assetsto their backend inside nginx with relative URLs, so a page in the browser never needs the backend's name. The gateway'slist_website_urlstool hands the agent the frontend's address.Tests
Unit.
DATABASE_URL, noservicedbdependency and no schema; without it onwebsite-networkit keeps all three.website-networkand prepares schemas without it, for the configured browser and a run's own.init-env-stateprepares no schema for the browser.Integration.
test_gateway_with_multi_env_including_websitenow has the browser try both MCP servers, the site backend,servicedb, pgweb and db-mcp by name, and requiresERR_NAME_NOT_RESOLVEDfor each.http://slack/resolves there.On an agent-environments-admin EC2 box, at this head:
Before the rebase, on the same kind of box: the full gateway suite (27 passed) and the env, artifact and bundle integration suites (82 passed).
Before the rebase, a real
modal_vmdeploy of a MultiEnv with an MCP server and a site:servicedband the site backend by name;/api/query, db-mcp's 9 tools andexecute_sql, and a data load all work.PSI Bench Holiday Rush on real
modal_vmenvs, run throughagent-env task runagainst prod with 3 runs on main and 3 on this branch before the database change:psi_processscores (0.13–0.2);website-networkalone, resolves only the gateway and the Craftweb frontend, times out by IP on everyenv-networkcontainer (servicedb:5432, pgweb, db-mcp, the site backend), loads the site (HTTP 200) and reaches S3;Earlier, chaos, main against this branch on the same box, with:
docker compose up -d --force-recreate./api/query), db-mcp,servicedb, the site backend, both MCP servers, by nameOn both, after every restart and the recreate: the operator's pgweb
/api/queryand db-mcpexecute_sqlwork, and loading data through the gateway works.Not covered here
These are the next PR, the gateway's control token:
modal_vm:172.17.0.1, and each compose network's gateway)./svcrelay and/agentenvdata plane stay open.A sidecar a task adds keeps its published port and stays on
env-network.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge within its stated scope.Summary
The PR separates the website browser from backing services and stops giving it database credentials or a schema.
earakely-scaleexplicitly defers access through host-published SQL ports and the gateway’s open/svcand/agentenvroutes to the next control-token PR. These are acknowledged limits, not new findings.Review checks were code-only; no tests or services were run.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Browser[Website browser] --> Sites[website-network] Sites --- Gateway[Gateway] Sites --- Entry[Website frontend or backend-only site] Gateway --- Env[env-network] Entry --- Env Env --- MCP[MCP servers] Env --- Backend[Separate website backends] Env --- DB[Database and SQL consoles]Reviews (5) · Last reviewed commit: "refactor(env): MCPServerConfig states it..." · Reviewed by Greptile