Repository navigation
feat(gateway): a composed card states each child's environment_name, which lookups by name read (FD-5376) - #557
Merged
earakely-scale merged 3 commits intoNov 9, 2026
Conversation
…which lookups by name read (FD-5376) The gateway sets environment_name on each entry of children_environments: an MCP server's key without its mcp- prefix, a website's or a computer's key itself. EnvironmentCard gains the optional field; ChildEnv carries it, and known_as (the stated name, else the card's own) is what child_named, find_child, DeployedEnv.child_env, website_child, legacy_protocol's server listing, the MCP CLI builder and site routing's _served_as look children up by. A server or website whose card is named apart from its environment name is no longer missed by loads, snapshots and clock sync; a card from a gateway that states none resolves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… so mcp-foo and mcp-mcp-foo stay apart The gateway named a route by whether its key, or the key without mcp-, was an internal MCP server's name, so with MCP servers foo and mcp-foo both routes, mcp-foo and mcp-mcp-foo, were named mcp-foo. route_environment_name now asks the route's backend: of the two readings, the MCP server mcp-<name> or a child env under its own name, the one whose internal MCP endpoint is under the route's base address wins, else the one on its host, as a server whose card is on another port than its MCP endpoint is. With neither, an mcp- key is an MCP server's route, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ent_name, by which its website is found, listed and snapshotted The shop website's card is named webitems, so the deploy that already serves it beside items and the desktop checks the gateway's card names it shop, child_env finds it, card_servers lists it as a website and the snapshot keeps it as shop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/fd-5376-gateway-card-environment-name
branch
November 9, 2026 16:43
Merged
5 tasks done
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
FD-5376, decision 2a of the site routing over the protocol design note.
The gateway now states each child env's
environment_nameon its entry inchildren_environments, and every lookup by name reads it. Until now, the environment name appeared only inside the child's URL path,/svc/<name>/.DeployedEnv.child_envmatched on the child card's ownname, so a server or website whose card is named differently from its environment name was missed by loads, snapshots and clock sync. Site routing parsed the path instead. SDK-built envs serve their environment name as their card name, so they never hit this.What changes
EnvironmentCardgains an optionalenvironment_name, documented in the README.ChildEnvcarries it, andknown_asgives the name a lookup uses:environment_name, else the card'sname.child_namedandfind_childlook children up by it._rewrite_child_cardsetsenvironment_nameon each child, resolved from the route's backend (route_environment_name), so MCP serversfooandmcp-foostay apart.mcp-<name>, so the prefix comes off.mcp-.DeployedEnv.child_env;website_child, which checks a website's route;legacy_protocol.card_servers, which names the servers that snapshots, clock sync andapply_server_configlist;build_mcp_cli;sites._served_as, which picks and names routed sites.environment_nameresolves exactly as before, by the card's name and the URL path.Test plan
Unit:
mcp-…;known_as,child_namedandfind_child;child_envfinds a child whose card is named otherwise, and tells a website from an MCP server by route;card_serversnames servers by the stated name;deployed_sites(services=...)picks a website by the stated name rather than its path;The full unit tier and the protocol tests pass locally, apart from the one Windows disk-recipe test that fails on this Mac without these changes.
CI green at 4c17c89: all 34 checks, the slow integration tier among them.
Integration, in CI's slow tier (af450dc, passed; all 34 checks green): the existing multi env computers e2e (
test_a_computer_in_a_multi_env_is_served_through_its_gateway_under_its_name_and_torn_down_with_it) already deploysitems, theshopwebsite whose card is namedwebitems, and the desktop. It now also asserts that the gateway's card statesitems,shopanddesktop, thatchild_env("shop", mcp=False)finds the website, thatcard_serverslistsshopas a website and nowebitems, and that the snapshot keeps it asshop. That adds no deploy. Thefoo/mcp-foocollision stays covered by unit tests: a deploy can't hold both items servers, which share a tool name.VM e2e and chaos, comparing base eb2ce63 with this head. One multi env serves the items image under three environment names,
items,mcp-itemsandstock, beside a website whose card is namedwebitemsand served asshop. Each server's one fixed tool name is renamed, because a gateway refuses duplicate tool names.child_env("shop")/svc/shopcard_serversfor the websiteshop, a websitewebitems, counted as an MCP servershopwebitemsstock, then two loads at once intomcp-itemsanditemsdocker restartthe stock server, then loadOn e236aaf, before the round-1 fix, the real gateway stated
environment_name: mcp-itemsfor both theitemsandmcp-itemschildren, sochild_env("items")found nothing. That was Greptile's P1, and 4c17c89 fixes it.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the added integration checks match the deployed website and snapshot behavior.Summary
The gateway now states each child’s
environment_name. Name-based lookups use it while keeping the fallback for older cards.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Backend[Child card] --> Gateway[Gateway adds environment_name] Gateway --> Card[Composed card] Card --> Lookup[Name-based lookup] Card --> Servers[Server listing] Servers --> Snapshot[Snapshot uses registered name]Reviews (11) · Last reviewed commit: "test(gateway): the multi env e2e asserts..." · Reviewed by Greptile