"""Source entry point used by Docker and local `python server.py` runs. Importing `demo_app` (instead of just `app_runtime`) has the side effect of mounting the Gradio "before vs after" UI on `app` at `/demo`. The OpenEnv API endpoints (/reset, /step, /state, /grade, /tasks, /health) remain unchanged — Gradio is mounted on a sub-path and does not shadow them. """ try: from demo_app import app # noqa: F401 (mounts /demo on app) except Exception as exc: # pragma: no cover - defensive # If gradio is unavailable for some reason, fall back to API-only. import logging logging.getLogger(__name__).warning( "demo_app import failed (%s); serving API only without /demo", exc ) from app_runtime import app # noqa: F401 from app_runtime import main if __name__ == "__main__": main()