Skip to content

feat(computers): the browser computer follows the universe clock, and loads live sites at any date (FD-5706) - #708

Merged
earakely-scale merged 10 commits into
mainfrom
edgararakelyan/fd-5706-hb113-the-multi-envs-website-browser
Nov 17, 2026
Merged

earakely-scale merged 10 commits into
mainfrom
edgararakelyan/fd-5706-hb113-the-multi-envs-website-browser

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Collaborator

What

A multi env's browser computer (the chromium website browser on the ubuntu-24.04-browser base) now follows the universe clock, as the desktop has since HB1.6. A page's Date.now() shows the universe's date when armed, after a jump, and after a reset. Live sites load at any universe date through the egress proxy, as they do on the desktop.

FD-5706 (HB1.13, part of FD-5420).

How

The browser base (src/agent_env/computers/artifacts/ubuntu-24.04-browser/) now matches the desktop's clock setup:

  • It starts as root (start_as = "root"). Root's supervisord (root.conf, new) runs the clock follower as agentenv-clock and the egress proxy as agentenv-egress. The session's supervisord runs as the session user, and it runs Xvfb, the stand-in site proxy, the driver and Chromium.
  • It preloads agent-env's libfaketime and the TLS shim, with clock.conf. The root start's init creates the clock page and boots the egress proxy.
  • Xvfb runs with -s 0 -dpms, as on the desktop.
  • Nothing changes in core or the page driver for the clock itself. The driver serves clock/v1 sync_time once the base has the follower, and core already configures every computer that serves it, at deploy and after a reset.

Copies, not a shared image. clock/, egress/, root/ and root.conf are copied from ubuntu-24.04/. A base image builds only from its own folder.

  • root/ is new, in both bases. install.sh runs at the build and sets up the clock's and the egress proxy's users, folders and permissions, the trust files and the preload. init runs at boot and covers the timezone, the clock page, egress boot and root's supervisord. Each base's Dockerfile copies the files into place and runs install.sh. Each base's start script hands init to root/init, so start-desktop init still works for the release's disk boot check.
  • test_computer_browser_clock_base.py fails if any copy differs from the desktop's by a byte.
  • The Go Dependabot entry now lists both folders under one group, so one PR bumps both.
  • FD-5700 can replace the copies with a shared image later, with no behavior change.

Live sites at any date. The egress proxy listens where AGENTENV_EGRESS_PROXY names, else on 127.0.0.1:3128 as on the desktop. The browser base sets it to 127.0.0.1:3130, since the stand-in site proxy already holds 3128. So the address is set in one place, and root.conf is the same file in both bases.

  • Deployed alone: the base's stand-in site proxy (site-proxy.py) hands every connection whose addresses are all public to the egress proxy.
  • In a multi env: core's site proxy hands it the direct live hosts (site_proxy.open_live).
  • Not handed over: private and loopback addresses still go straight to the site, since the egress proxy refuses them.
  • Address: both proxies read the egress proxy's address from AGENTENV_EGRESS_PROXY, which the base sets. The desktop doesn't set it, so it's unchanged.
  • One behavior, two clients: the stand-in has only the standard library in the image, so it can't share core's code. test_computer_egress_hand_off.py runs the same cases against both hand-offs: which addresses are public, the CONNECT sent, and established, refused, closed and endless answers. Both raise the same EgressRefused with the same messages.
  • Real time: the stand-in carries AGENTENV_REAL_TIME=1, so its network log stays on real time.

The Playwright MCP website browser stays on real time, as decided on FD-5706. A task whose pages need the universe's date uses a browser computer (browser_envs = ["chromium"]).

Behavior changes worth knowing

  • The browser computer's container now starts as root, like the desktop's. docker exec already defaults to root in a computer.
  • Unarmed, the browser computer's live sites go through the egress proxy, which relays TLS untouched (splice, decision real). One more local hop, nothing else.
  • The browser computer listens on 3130 too (the egress proxy), on loopback only.

Verification

On the x86 test host (Linux, local Docker):

  • New, tst/integration/computer/browser_clock_test.py, 2 passed:
    • The browser computer in a multi env with a synthetic site and the live github.com site, armed two years back through sync_env_clock:
      • its driver syncs with the follower named chromium, armed;
      • a page's Date.now() is within 3 s of the gateway's universe when armed, after a one-week advance and after a reset_env;
      • the synthetic site loads by name, and github.com loads through the egress proxy, which logs intercept/outside. github.com's real certificate isn't valid two years back.
    • The browser computer alone: Date.now() is real time, and https://example.com/ loads, with the egress proxy logging splice/real for it.
    • Each page is checked over CDP: no navigation error, and its own text in its title or body. An earlier check matched a tab's title, which is the tab's URL until the page sets one.
  • Desktop tests, 6 passed: egress_test.py, chromium_universe_test.py and computer_clock_test.py, so the desktop is unchanged.
  • After moving the root start into root/ (468e78b, ee59b6c), on the x86 host unless noted:
    • desktop: base_computer_test.py, egress_test.py, computer_clock_test.py, chromium_universe_test.py, 17 passed;
    • browser: browser_clock_test.py, the chaos file below, browser_computer_test.py, 32 passed and 4 skipped (Playwright and Puppeteer clients, which need Node 20 or later and npm);
    • the desktop's disk form, composed and booted under KVM on the vm host (disk_boot_test.py), 1 passed;
    • both egress copies' Go suites;
    • the stand-in's budget fix after it (d45211c), by its unit tests and the hand-off test;
    • the unit tier on a Mac, 15,224 passed. One test this PR doesn't touch, test_docker_image_github_clone.py::…[secrets], hung there and didn't finish; CI runs it on Linux.
  • Chaos and an agent over CDP, 3 passed. This is a by-hand file, not in this PR. In a multi env armed two years back:
    • Egress proxy killed: back in 1.0 s with the same CA, and live sites load again.
    • Egress proxy stopped: live sites fail at once (ERR_TUNNEL_CONNECTION_FAILED, in about 1 s, no hang), synthetic sites still load, and live sites come back once it starts.
    • Clock follower killed: back in 1.0 s, and it shows the next jump.
    • Clock follower stopped: a write waiting for followers answers 504, and the page stays a week behind. Once started, it catches up to within 0.3 s.
    • Gateway restarted: the gateway is unarmed and pages show real time. sync_env_clock arms it again, within 0.3 s.
    • Rates and dates: a rate of 60 runs at 60.04 on the page. At 2099 and at 1975, pages are within 0.5 s and github.com loads, intercepted.
    • Load: eight live github.com tabs load at once, in 1.5 to 2.5 s each.
    • A live name that doesn't resolve: it fails in about 1 s, and the next live load works.
    • An agent over CDP (browser_connect_cdp, through the gateway): it reads a page's Date.now() as two years back (within a second), and loads github.com.
    • Alone, clock off: ten live sites load at once, all spliced. A killed egress proxy comes back, and a stopped one fails loads at once, with the stand-in logging no answer.
  • Existing browser tests, 41 passed, 4 skipped: browser_computer_test.py, browser_multi_env_test.py and website_browser_test.py. That includes the stand-in's live github.com test, now through the egress proxy. One assertion was updated: the browser computer's listening ports now include 3130.
  • The egress proxy's Go suite (gofmt, vet, go test -race) passes in both copies, including the new serve --listen test.
  • Unit tests:
    • 662 computer unit tests pass, including the new copy-equality and browser-base tests, and the stand-in and core site proxy hand-off tests (public through egress, private direct, a refusal reported as a 502).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable new issue remains.

Summary

Browser computers now follow the universe clock and send public live-site connections through the egress proxy.

  • Browser pages now follow the universe clock in multi envs.
  • Browser site proxies send live public traffic through the egress proxy.
  • Desktop startup uses shared root setup scripts.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Gateway[Gateway clock] --> Follower[Browser clock follower]
  Follower --> Page[Shared clock page]
  Page --> Chromium[Chromium clock reads]
  Chromium --> SiteProxy[Site proxy]
  SiteProxy -->|Public live host| Egress[Egress proxy on real time]
  Egress --> Live[Live site]
  SiteProxy -->|Private host| Private[Private site]
Loading

Reviews (11) · Last reviewed commit: "revert(task_step): sync_env_clock doesn'..." · Reviewed by Greptile

earakely-scale and others added 4 commits November 16, 2026 09:05
… its live sites load at any date

The ubuntu-24.04-browser base starts as root, runs the clock follower and the egress proxy under
root's supervisord and the session's under its own, and preloads the clock library and the TLS
shim, so the page driver serves clock/v1 sync_time and core configures it as it does the desktop.
Its clock/ and egress/ are copies of ubuntu-24.04's, which a unit test keeps byte for byte.

The egress proxy takes --listen (3130 here, the base's stand-in site proxy holding 3128), and the
stand-in and core's site proxy hand it every connection to a public address when the base names
it in AGENTENV_EGRESS_PROXY, so a live site loads at any universe date; private and loopback
addresses still go straight. The stand-in keeps real time for its network log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wser shows real time

The playwright-mcp website browser follows no clock, so the pages it opens see real time once a
multi env is armed. The step says so, naming the browser computer (browser_envs = ["chromium"]),
which follows the gateway as a desktop does, for pages on the universe's date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the egress proxy's port among the browser computer's

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ollower under the computer's name

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 16, 2026 17:53
earakely-scale and others added 4 commits November 16, 2026 10:02
…, marked via egress

The site proxies logged the first address a live site resolved to, but the egress proxy resolves
it again and decides which address to dial, after the browser's TLS hello. Such a connection's
lines now name the egress proxy's address with "via": "egress"; the egress proxy's own log names
the address it dialled. The shipped base's file list takes egress/main_test.go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… CDP, not by a tab's title

A tab's title is its URL until its page sets one, so the synthetic site's check, which matched any title, passed
before the page had loaded. Each page now loads over CDP and passes only with no error and its word in what it shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s proxy from one checked copy

The clock's and egress proxy's users, folders, permissions and preload were copied by hand into each base's
Dockerfile and init, outside what the copy check covered. They are now root/install.sh, run at the build, and
root/init, run at boot, and root.conf is one file; the browser base's copies of clock/, egress/, root/ and root.conf
must match the desktop's byte for byte. egress serve listens where AGENTENV_EGRESS_PROXY names, else 127.0.0.1:3128,
so neither base passes it an address. The browser's Dockerfile says which egress files it leaves unused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xy alike

The stand-in and core's site proxy each carry their own CONNECT to the egress proxy, since the stand-in has only the
standard library in the image. One test now runs the same cases against both: which addresses are public, the CONNECT
sent, and established, refused, closed and endless answers, each refused with the same EgressRefused and message.
Core's open_live is split into egress_proxy, public and through_egress to match the stand-in's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 2 commits November 16, 2026 17:18
…nnect budget lasts

A lookup that took the whole CONNECT_TIMEOUT_S still gave the egress proxy a tenth of a second. It now reports none
within the budget, as the direct path does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…CP website browser

It keyed on the browser's name and only reached the logs, and the step's log already lists playwright-mcp among the
servers it skipped. A task whose pages need the universe's date uses a browser computer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit d425289 into main Nov 17, 2026
39 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-5706-hb113-the-multi-envs-website-browser branch November 17, 2026 06:13
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