Skip to content

feat(website): a session cookie per site, and conformance levels (FD-4683) - #444

Merged
earakely-scale merged 3 commits into
mainfrom
wloo/website-sdk-followups
Nov 6, 2026
Merged

earakely-scale merged 3 commits into
mainfrom
wloo/website-sdk-followups

Conversation

@williamloo-scale

@williamloo-scale williamloo-scale commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Website SDK follow-ups, lifted onto main (after #428's final rounds rewrote the SDK and #429 landed).

  • Session cookie per site. agentenv_session_<name>, from the name the card gives (a name a cookie name can't hold is spelled safely, with a hash), and named on the card, so two sites a browser reaches under one gateway host (/website/a/, /website/b/) don't overwrite each other's sign-in. The shared agentenv_session is no longer read: a website browser's cookies last one run and every site in a run is built from one image.
  • Conformance: required vs recommended. What a website env's server must do fails a run: a card declaring its domains, readiness and routes; any host; readiness; no page at the reserved paths (new); and the data plane the card advertises, round-tripped (a card advertising none fails). X-Universe-Now, the clock, forwarded headers and cookies (now also: the session path sets the card's cookie) are warned, main's existing status; --strict fails on a warning. Each line says (required) or (recommended). A page plus /api/health with no card or data plane fails, as on main.

Left out

  • The clock rate (virtual_seconds_per_real_second): main's site clock reads the gateway's clock once per request, so it no longer extrapolates and has no rate to learn.
  • models=: it read and wrote through the store main removed (sites keep their own data behind data hooks now), so it waits for a design note. The db/SQLAlchemy extra goes with it.

Test

  • Protocol website tests: 212 passed (with a built Notes page, so the prefix test runs too); protocol suite 1,233 passed earlier on this change.
  • Framework tst/unit/env/gateway, env/envs, bundle: 2,600 passed, 2 failed; the 2 (test_disk_recipe.py, the disk launcher) fail the same on unchanged main on this Mac.
  • Headless Chrome, two Notes sites behind one host at /website/a/ and /website/b/: on main, signing in as ben on a is undone by opening b (one shared cookie, which b can't read and replaces); with this change each keeps its own cookie (agentenv_session_notes-a, agentenv_session_notes-b) and a stays ben.

E2E (agent-environments-admin VM, real gateway, local sandbox)

Two Notes sites (notes-a, notes-b) in one multi env with the run's Playwright website browser, driven through the gateway's MCP as an agent does, both at http://gateway:18765/website/<name>/:

  • Cards name agentenv_session_notes-a / -b, and each site sets its own cookie. Signed in as ben on notes-a, then notes-b opened (ann), notes-a is still ben.
  • The same flow with the sites built from main's protocol: both set agentenv_session, and notes-a is back to ann after notes-b is opened.
  • Conformance through /svc/notes-a: 9 passed, also with --strict (before the card and data plane became required; the Notes image passes 9/9 with them required). Through /website/notes-a the required readiness check fails, as the gateway keeps the card off a site's route.
  • Chaos: a site restart keeps the browser's sign-in; a stopped site answers 502 while the other answers 200, and signs in again once started; 40 concurrent clients signing in to both sites as different users all read their own users back.
  • Found, not from this PR (same on main), filed as FD-5285: a gateway restart leaves the website browser on about:blank in a new browser context, so its cookies and sign-ins are gone, while the sites still know the sessions (a plain client stays signed in).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge, with legacy-cookie compatibility supplied by PR #445.

Summary

This PR gives each website its own session cookie and separates required checks from recommended checks.

  • Each named website keeps its own browser session cookie.
  • The checker labels website rules and lets strict mode fail on warnings.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Run each check] --> B{Required?}
  B -->|Yes, check fails| C[failed]
  B -->|No, check fails| D[warned]
  C --> E[Run fails]
  D --> F{strict?}
  F -->|Yes| E
  F -->|No| G[Warning does not fail run]
Loading

Reviews (19) · Last reviewed commit: "refactor(website): each conformance chec..." · Reviewed by Greptile

@williamloo-scale williamloo-scale changed the title website: per-site session cookie, /go?sid=, clock rate, conformance levels, models= (FD-4683) feat(website): a session cookie per site, /go?sid=, the clock's rate, conformance levels and models= (FD-4683) Nov 3, 2026
@williamloo-scale
williamloo-scale marked this pull request as ready for review November 3, 2026 00:24
@williamloo-scale
williamloo-scale requested a review from a team as a code owner November 3, 2026 00:24
@williamloo-scale
williamloo-scale force-pushed the wloo/website-gateway-auth branch from 8dcebd1 to 4c1fcc1 Compare November 3, 2026 21:50
@williamloo-scale
williamloo-scale force-pushed the wloo/website-sdk-followups branch from 8090f3e to 2d64812 Compare November 3, 2026 21:50
@williamloo-scale
williamloo-scale force-pushed the wloo/website-gateway-auth branch from 4c1fcc1 to 22947c3 Compare November 3, 2026 22:52
@williamloo-scale
williamloo-scale force-pushed the wloo/website-sdk-followups branch 2 times, most recently from 0ef31b9 to 615d6a0 Compare November 3, 2026 23:47
@williamloo-scale
williamloo-scale force-pushed the wloo/website-gateway-auth branch from 22947c3 to 253eaec Compare November 3, 2026 23:47
@williamloo-scale
williamloo-scale force-pushed the wloo/website-sdk-followups branch from 718dbb1 to 65a1c8e Compare November 4, 2026 03:37
@williamloo-scale
williamloo-scale force-pushed the wloo/website-gateway-auth branch from 253eaec to 18b1b98 Compare November 4, 2026 03:37
@williamloo-scale
williamloo-scale force-pushed the wloo/website-gateway-auth branch from 18b1b98 to d95702e Compare November 4, 2026 03:56
@williamloo-scale
williamloo-scale force-pushed the wloo/website-sdk-followups branch from 65a1c8e to 0f672be Compare November 4, 2026 03:56
@williamloo-scale williamloo-scale changed the title feat(website): a session cookie per site, /go?sid=, the clock's rate, conformance levels and models= (FD-4683) feat(website): a session cookie per site, the clock's rate, conformance levels and models= (FD-4683) Nov 4, 2026
@williamloo-scale
williamloo-scale force-pushed the wloo/website-gateway-auth branch from d95702e to 8389f76 Compare November 4, 2026 04:40
@williamloo-scale
williamloo-scale force-pushed the wloo/website-sdk-followups branch from 0f672be to 3184f79 Compare November 4, 2026 04:40
@earakely-scale
earakely-scale force-pushed the wloo/website-gateway-auth branch from 8389f76 to c7f214b Compare November 5, 2026 06:42
Base automatically changed from wloo/website-gateway-auth to main November 5, 2026 16:21
@earakely-scale
earakely-scale force-pushed the wloo/website-sdk-followups branch from e759024 to f4ac35d Compare November 6, 2026 00:26
…4683)

- Session cookie per site: agentenv_session_<name>, the name the card gives (a name a cookie name can't hold is
  spelled safely, with a hash), named on the card, so two sites a browser reaches under one gateway host
  (/website/a/, /website/b/) don't overwrite each other's sign-in. A site still reads the shared agentenv_session
  for one release.
- Conformance: required vs recommended. What website/v1 requires of any server fails a run: any host, readiness, no
  page at the reserved paths (new), and the data-plane round trip when the card advertises one. The card's details,
  X-Universe-Now, the clock, forwarded headers and cookies (including the session path setting the card's cookie)
  are warned; --strict fails on a warning.

Lifted onto main from the follow-ups branch. The clock-rate change is left out (main's site clock reads the gateway
clock per request, so it no longer extrapolates), and models= is held for a design note (it read and wrote through
the store main removed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale force-pushed the wloo/website-sdk-followups branch from f4ac35d to 190bfd1 Compare November 6, 2026 00:27
@earakely-scale earakely-scale changed the title feat(website): a session cookie per site, the clock's rate, conformance levels and models= (FD-4683) feat(website): a session cookie per site, and conformance levels (FD-4683) Nov 6, 2026
earakely-scale and others added 2 commits November 5, 2026 17:32
With them recommended, a server answering pages and /api/health with no card and no data plane passed every required
check, though agentenv resets, seeds and reads a site through them. A card listing no data plane now fails too, rather
than skipping the round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a site reads only its own session cookie (FD-4683)

- A check's required or recommended level sits beside the check, not in a separate list of names, so a new check
  can't fall back to recommended by being left off it.
- The shared agentenv_session is no longer read: a website browser's cookies last one run, every site in a run is
  built from one image, and nothing sends the shared cookie.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 749a6ab into main Nov 6, 2026
35 of 36 checks passed
@earakely-scale
earakely-scale deleted the wloo/website-sdk-followups branch November 6, 2026 02:20
earakely-scale added a commit that referenced this pull request Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants