Skip to content

feat(website): a website env is one server image, checked at its health path (FD-4683) - #390

Open
williamloo-scale wants to merge 5 commits into
mainfrom
wloo/web-app-contract
Open

williamloo-scale wants to merge 5 commits into
mainfrom
wloo/web-app-contract

Conversation

@williamloo-scale

@williamloo-scale williamloo-scale commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Implements the website env item of M5 in CUA Env: Computer Envs and Computer App Envs (Websites in the computer, agreed Oct 26), extending the existing WebsiteEnv. A website env is one server image that serves the site's pages and API, so it no longer needs a separate frontend image. An env with one still deploys, put warns that it's deprecated, and a bundle may leave it out. The env declares the health path that answers once it's usable. Existing envs keep loading: the server image is written as server_docker_image_artifact beside backend_docker_image_artifact, which an older document holds and is read as the server image, and backend_image in an env.toml names it. Declared domains wait for the M5 site proxy that routes by them.

Validation: unit suite passes, with tests for one-image envs, health-path refusals, reading an older document, the frontend deprecation warning, and an optional image key in a bundle.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

Fix the health-path fallback before merging so healthy sites without JSON cards can deploy.

Fix All in CursorFindings

  1. P1 Healthy websites cannot deploy ▶
Fix with agent prompt
### Issue 1
src/agent_env/providers/env_providers/env_gateway_provider.py:1648
If a site returns its default HTML page for unknown paths, `_website_ready()` tries to parse the 200 response from `/.well-known/agent-env.json` as JSON. That raises `ValueError`, so every retry skips the declared `health_path` until deployment times out-even when that endpoint answers 200. Treat an unreadable card as absent and continue to the health check.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Makes WebsiteEnv deploy from one server image while preserving older two-image records.

  • Website environments can use one server image for pages and APIs.
  • The gateway routes one-image sites and waits for them to be ready.
  • Browser routes cannot reach a site's framework data paths or card.
  • Tasks can check values from a website's saved session state.
  • The Notes example now includes its browser build dependencies.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[WebsiteEnv] --> B[Gateway deploy]
  B --> C[Start server image]
  C --> D[Fetch site card]
  D --> E{Readiness method advertised?}
  E -->|Yes| F[Poll ready method]
  E -->|No| G[Poll declared health path]
  D -->|HTML returned with 200| H[JSON parsing fails]
  H --> I[Retry until deploy fails]
  F --> J[Return deployed website]
  G --> J
Loading

Reviews (10) · Last reviewed commit: "feat(website): the gateway serves a one-..." · Reviewed by Greptile

@williamloo-scale
williamloo-scale marked this pull request as ready for review October 29, 2026 21:03
@williamloo-scale
williamloo-scale requested a review from a team as a code owner October 29, 2026 21:03
Comment thread src/agent_env/env/envs/web_apps/env.py Resolved
@williamloo-scale williamloo-scale changed the title feat(web-apps): web app artifacts and the web_apps env, keyed by what they compose feat(web-apps): web app artifacts and the web_apps env, keyed by what they compose (FD-4683) Oct 29, 2026
@williamloo-scale williamloo-scale changed the title feat(web-apps): web app artifacts and the web_apps env, keyed by what they compose (FD-4683) feat(web-app): web app artifacts and the web_app env, one website keyed by what it composes (FD-4683) Oct 30, 2026
@williamloo-scale williamloo-scale changed the title feat(web-app): web app artifacts and the web_app env, one website keyed by what it composes (FD-4683) feat(website): a website env is one server image, at its domains, checked at its health path (FD-4683) Oct 30, 2026
Comment thread src/agent_env/env/envs/website.py Resolved
Comment thread src/agent_env/env/envs/website.py Resolved
Comment thread src/agent_env/env/envs/website.py Resolved
…th path (FD-4683)

A site's server image serves its pages and API, so a website env no longer needs a separate frontend image: one
still deploys, put warns that it's deprecated, and a bundle may leave it out. The env declares the path that answers
once it's usable, which holds only plain path characters. The server image is stored as
server_docker_image_artifact beside backend_docker_image_artifact, which an older document holds and is read as it,
and backend_image in an env.toml names it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@williamloo-scale williamloo-scale changed the title feat(website): a website env is one server image, at its domains, checked at its health path (FD-4683) feat(website): a website env is one server image, checked at its health path (FD-4683) Oct 30, 2026
… plane off the site's route (FD-4683) (#391)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s path (FD-4683)

website/v1 reserves /.well-known/agent-env.json for the env card, and
conformance's required reserved-paths check already fails a server
that answers it with a page. A deploy waiting for such a site (a
single-page app answering every path with index.html) failed to read
the card on each poll and timed out. It now refuses the site at once
with WebsiteContractError, naming the path and what answered it. Any
answer but 200 there is still no card, which falls back to the health
path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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