Repository navigation
Redirect the served world's root address to the web console - #50
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
seahaven serveends its startup output with uvicorn'sUvicorn running on http://127.0.0.1:8000. That is the most prominent link, and it answered404 {"detail":"Not Found"}.What
GET /now redirects (307) to/consolewhenever the console is served./console, becauseopenenv pushclassifies an app by its path names.--no-consoleleaves/a 404.ENABLE_WEB_INTERFACE=true(whichopenenv pushwrites into a Space's Dockerfile), OpenEnv has already registered its ownGET /→/web/. Starlette matches the first route, so that redirect stays OpenEnv's./to a console that a later--no-consoleturned 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,/schemaand/mcp, and reads/reset,/stepand/stateonly as OpenAPI path names. It never requests/./health.AutoEnvfalls back to/only when/healthis not 200, andrequestsfollows the redirect anyway.Tests
In
tests/test_server.py, each against a real server:test_the_bare_address_redirects_to_the_console: the 307 and itsLocation, following it lands on the console HTML,/is not in the OpenAPI paths, andvalidate_running_environmentpasses. It fails when the route line is removed.--no-consoletest now checks that/is a 404./is still OpenEnv's/web/redirect.All the checks in AGENTS.md pass in both environments (
serveandmcp).🤖 Generated with Claude Code
https://claude.ai/code/session_012VSstKuLnvzrphseRSurue
Generated by Claude Code