Skip to content

fix(gateway): list a site that declares no names at its .localhost name, as a browser computer opens it - #777

Merged
earakely-scale merged 4 commits into
mainfrom
edgararakelyan/fd-6251-list_website_urls-gives-a-site
Nov 18, 2026
Merged

earakely-scale merged 4 commits into
mainfrom
edgararakelyan/fd-6251-list_website_urls-gives-a-site

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

A multi env whose website browser is a computer (browser_envs = ["chromium"]) lists its sites by name in list_website_urls, because the browser runs on a sandbox of its own and can't reach the sites' containers. A site that declares no names, with no domains and none on its card, was listed at its backend address, e.g. http://gate-website-website-frontend/, which the browser can't resolve.

The computer's site proxy already routes such a site at fallback_name(site) (<site>.localhost), and its start tabs open it there. Now the gateway lists that name too, so an agent that opens a site from list_website_urls lands on it.

  • Gateway._listed_urls: a site listed by name whose stored names and card both declare none is listed at fallback_name of the name it goes by, as the site proxy names it. That's its website/v1 card's name, unless two of the env's cards give one name, and then each site goes by the name it's served as. A site whose card can't be read yet keeps its address, as before, until the card can be read, so a site that would declare names isn't listed at the wrong one.
  • The rule lives in one place for both sides: fallback_name moves from computer/utils/sites.py to gateway/rest_proxy.py, next to listed_url, beside the new served_names (which sites._served_names now calls) and website_card_name (which the gateway's SiteCard keeps as card_name, beside names, the hostnames). sites.py imports them from there; the gateway package keeps importing only its own modules.

Why

Chromium's first dev promotion on AgentEnvHub failed its browser_page check on modal_vm. Its browser recording shows the start tab loading http://gate-website.localhost/ (200), then the probe navigating to the address list_website_urls gave, http://gate-website-website-frontend/, and failing. M8.13's integration test covers only sites with stored or card names, so the nameless case wasn't exercised.

Tests

  • test_list_website_urls_gives_a_site_listed_by_name_at_its_first_name_and_any_other_behind_the_gateway: bare now expects http://bare.localhost/, and Old_Notes expects http://old-notes.localhost/ (same lowercase and _ rule as the site proxy). It fails on main.
  • New: test_list_website_urls_gives_a_site_listed_by_name_its_address_while_its_card_cant_be_read.
  • New: test_a_site_declaring_no_names_is_listed_at_the_fallback_of_the_name_its_card_gives_it_as_a_proxy_routes_it. notes with the card NotesApp is listed at http://notesapp.localhost/, and two cards both named Shop send every site to its served name (Greptile r1).
  • New: test_list_website_urls_reads_no_card_when_every_site_listed_by_name_stores_its_names. Cards are read at once, and those of sites with stored names only when some site needs a fallback (Greptile r2).
  • tst/unit/env/gateway/rest_proxy_stream_test.py, tst/unit/env/envs/test_computer_sites.py, tst/unit/env/envs/test_multi_env_computers.py: 1309 passed locally (tst/unit/env/gateway/ plus the two site test files).

The live check is chromium's next dev promotion. It passes browser_page once dev's gateway serves the release with this fix.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new blocking issues were found.

Summary

The gateway now lists nameless websites at the same .localhost addresses used by the browser’s site proxy. The latest update renames SiteCard.name to card_name without changing behavior.

  • Nameless websites in the list now use the browser proxy's .localhost address.

Reviews (8) · Last reviewed commit: "refactor(gateway): SiteCard.card_name, s..." · Reviewed by Greptile

…ts .localhost name, as a browser computer opens it

A multi env whose website browser is a computer lists its sites by name, since the browser can't reach their
containers. A site declaring no names was listed at its backend address, which the browser can't resolve, while
the computer's site proxy routes it at fallback_name(site) and its start tabs open it there. The gateway now
lists that name too; a site whose card can't be read yet keeps its address until it can. fallback_name moves
next to listed_url so the gateway and the site proxy share one rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/agent_env/env/gateway/gateway.py Resolved
…ts card gives it, as the site proxy routes it

The site proxy names a site by its website/v1 card's name, unless two of the env's cards give one name, and then
each by the name it's served as; a site declaring no names is routed at fallback_name of that. The gateway now
keeps each card's name (SiteCard.name, website_card_name) and lists the sites by the same rule (served_names,
shared with sites._served_names), instead of by the name each is served as.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/agent_env/env/gateway/gateway.py Resolved
earakely-scale and others added 2 commits November 18, 2026 09:47
… sites' only when a fallback is needed

Greptile r2: reading every listed site's card one after another made a stalled card endpoint delay the whole
list, even when every site stores its names. Cards of sites without stored names are now read at once, and those
of sites with stored names only when some site needs a fallback, the one case their names can change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tnames a site is reached at

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 722e1a6 into main Nov 18, 2026
37 of 38 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-6251-list_website_urls-gives-a-site branch November 18, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant