How meta-pytorch/openenv works
OpenEnv is a framework for creating and interacting with isolated agentic execution environments through Gymnasium-style reset, step, and state operations. The main runtime flow is an agent client sending actions to a server, which delegates them to environment logic and returns observations; the shared server layer manages sessions and protocol handling. The repository also includes environment discovery/creation and a CLI for environment lifecycle tasks. The README documents provider and web-interface capabilities; source excerpts are incomplete, so uncertain implementation links are omitted.
Main entry points: http_server.py HTTP and WS server · envs Environment implementations · core Environment client · interfaces.py Environment logic
Components 21
Environment runtime
- Environment client
src/openenv/core - HTTP and WS server
src/openenv/core/env_server/http_server.py - Environment logic
src/openenv/core/env_server/interfaces.py - Container providers
Protocols and interfaces
- Action and state types
src/openenv/core/env_server/types.py - Message serialization
src/openenv/core/env_server/serialization.py - MCP environment
src/openenv/core/env_server/mcp_environment.py - MCP messages
src/openenv/core/env_server/mcp_types.py - Interactive web UI
src/openenv/core/env_server/web_interface.py
Environment authoring
- Environment implementations
envs - Kernel benchmark
envs/kernrl/server/kernrl_environment.py - Pi environment
envs/pi_env/server/pi_environment.py - Pi interactive UI
envs/pi_env/server/gradio_ui.py - ThinkingBox environment
envs/thinkingbox_env/server/thinkingbox_environment.py - Calendar domain
envs/calendar_env/server/database/models/event.py - CARLA logging
envs/carla_env/server/logging.py
Discovery and CLI
- Automatic discovery
src/openenv/auto/_discovery.py - Automatic environment client
src/openenv/auto/auto_env.py - OpenEnv CLI
src/openenv/cli/commands - CLI entry point
src/openenv/cli/__main__.py
Other components
- Agent application
Connections 20
- Agent application → Environment client: uses
- Environment client → HTTP and WS server: sends reset and steps
src/openenv/core/env_server/__init__.py - HTTP and WS server → Environment logic: dispatches operations
src/openenv/core/env_server/http_server.py - Environment logic → Action and state types: uses types
src/openenv/core/env_server/__init__.py - HTTP and WS server → Message serialization: serializes messages
src/openenv/core/env_server/http_server.py - HTTP and WS server → MCP environment: supports MCP
src/openenv/core/env_server/http_server.py - MCP environment → MCP messages: uses messages
src/openenv/core/env_server/__init__.py - HTTP and WS server → Interactive web UI: can expose UI
src/openenv/core/env_server/http_server.py - Environment client → Container providers: starts local containers
- HTTP and WS server → Environment implementations: hosts environments
src/openenv/core/env_server/http_server.py - Environment implementations → Kernel benchmark: includes
envs/kernrl/models.py - Environment implementations → Pi environment: includes
envs/pi_env/server/app.py - Pi environment → Pi interactive UI: serves UI
envs/pi_env/server/app.py - Environment implementations → ThinkingBox environment: includes
envs/thinkingbox_env/server/app.py - Environment implementations → Calendar domain: includes
envs/calendar_env/server/database/managers/event_manager.py - Environment implementations → CARLA logging: includes
envs/carla_env/server/logging.py - Agent application → Automatic discovery: discovers environments
- Automatic discovery → Automatic environment client: selects environment
- CLI entry point → OpenEnv CLI: dispatches commands
- Agent application → OpenEnv CLI: creates and deploys