Skip to content

Redirect the served world's root address to the web console - #50

Merged
scosman merged 1 commit into
mainfrom
claude/lucid-turing-sobcul
Oct 15, 2026
Merged

scosman merged 1 commit into
mainfrom
claude/lucid-turing-sobcul

Conversation

@scosman

@scosman scosman commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Why

seahaven serve ends its startup output with uvicorn's Uvicorn running on http://127.0.0.1:8000. That is the most prominent link, and it answered 404 {"detail":"Not Found"}.

What

  • GET / now redirects (307) to /console whenever the console is served.
  • The route is kept out of the OpenAPI schema, like /console, because openenv push classifies an app by its path names.
  • --no-console leaves / a 404.
  • With ENABLE_WEB_INTERFACE=true (which openenv push writes into a Space's Dockerfile), OpenEnv has already registered its own GET / → /web/. Starlette matches the first route, so that redirect stays OpenEnv's.
  • The redirect is 307, not a permanent 301/308, so a browser won't cache it and keep sending / to a console that a later --no-console turned off.

uvicorn's startup line and Seahaven's Starting. Web console will be available at … line are unchanged.

OpenEnv compatibility

Checked against the installed openenv:

  • openenv validate --url (cli/_validation.py) probes /openapi.json, /health, /metadata, /schema and /mcp, and reads /reset, /step and /state only as OpenAPI path names. It never requests /.
  • The container providers wait on /health.
  • AutoEnv falls back to / only when /health is not 200, and requests follows the redirect anyway.
  • The validator passes against a served world in all four combinations of console on/off and web interface on/off, before and after this change.

Tests

In tests/test_server.py, each against a real server:

  • test_the_bare_address_redirects_to_the_console: the 307 and its Location, following it lands on the console HTML, / is not in the OpenAPI paths, and validate_running_environment passes. It fails when the route line is removed.
  • The --no-console test now checks that / is a 404.
  • The web-interface test now checks that / is still OpenEnv's /web/ redirect.

All the checks in AGENTS.md pass in both environments (serve and mcp).

🤖 Generated with Claude Code

https://claude.ai/code/session_012VSstKuLnvzrphseRSurue


Generated by Claude Code

uvicorn prints the bare address as the server starts, and it is the line an
operator clicks; it answered 404. `GET /` now redirects to `/console` when the
console is on. The route is kept out of the OpenAPI schema, `--no-console`
leaves `/` a 404, and with `ENABLE_WEB_INTERFACE=true` OpenEnv's own `/` to
`/web/` is matched first and stays.

A test serves a world and runs OpenEnv's runtime validator against it, which
passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012VSstKuLnvzrphseRSurue
@scosman
scosman merged commit f1d15d7 into main Oct 15, 2026
3 checks passed
@scosman
scosman deleted the claude/lucid-turing-sobcul branch October 15, 2026 21:38
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.

1 participant