Conversation
Add quadruped example Added hopper examples Align example cli Fix libglx installation in docker and enable exiting with ctrl + c inside docker Add screenshots Increase random forces
- Rename directory from dmcontrol_env to dm_control_env - Update all internal import paths and module references - Add screenshots to README (cartpole.png, quadruped.png) - Update examples with consistent CLI args (--visual, --headless, --task) - Increase random force magnitude in hopper/quadruped examples
Greptile SummaryThis PR adds Key Features Implemented:
Implementation Quality:
Additional Improvements:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as DMControlEnv Client
participant WS as WebSocket Connection
participant Server as FastAPI Server
participant Env as DMControlEnvironment
participant DMC as dm_control.suite
Note over Client,DMC: Initialization
Client->>Server: HTTP GET /health
Server-->>Client: 200 OK
Client->>Server: WebSocket Connect
Server->>Env: Create Environment Instance
Env->>DMC: Load domain/task
DMC-->>Env: Environment ready
Server-->>Client: WebSocket Connected
Note over Client,DMC: Reset Episode
Client->>WS: reset(domain_name, task_name, render=True)
WS->>Server: WebSocket message
Server->>Env: reset_async()
Env->>DMC: reset()
DMC-->>Env: TimeStep (observations, reward)
Env->>DMC: render() [if render=True]
DMC-->>Env: RGB pixels
Env-->>Server: DMControlObservation (obs, pixels, reward, done)
Server-->>WS: JSON response
WS-->>Client: StepResult[DMControlObservation]
Note over Client,DMC: Step Loop
loop Until done
Client->>WS: step(DMControlAction)
WS->>Server: WebSocket message
Server->>Env: step_async(action)
Env->>DMC: step(action_array)
DMC-->>Env: TimeStep (observations, reward, done)
Env->>DMC: render() [if render enabled]
DMC-->>Env: RGB pixels
Env-->>Server: DMControlObservation
Server-->>WS: JSON response
WS-->>Client: StepResult[DMControlObservation]
end
Note over Client,DMC: State Query
Client->>Server: HTTP GET /state
Server->>Env: state property
Env-->>Server: DMControlState (domain, task, specs)
Server-->>Client: JSON response
Note over Client,DMC: Cleanup
Client->>Server: WebSocket Close
Server->>Env: close()
Env->>DMC: close()
DMC-->>Env: Cleanup complete
|
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
|
Nice! Will take a closer look on desktop in a few hours. |
|
Hey @mreso . Thanks for this and sorry to go quiet on this. Some high level changes please:
Thanks. |
Summary
Adds dm_control_env, a new OpenEnv environment wrapping https://github.com/google-deepmind/dm_control for MuJoCo-based continuous control tasks.
Key features:
Files added:
Type of Change
Alignment Checklist
Before submitting, verify:
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesRFC Status
Test Plan
cd envs/dm_control_env
PYTHONPATH=src:envs uvicorn envs.dm_control_env.server.app:app --port 8765
In another terminal:
python -c "from dm_control_env import DMControlEnv; c = DMControlEnv('http://localhost:8765'); print(c.reset())"
Claude Code Review
Alignment Review Report
Automated Checks
Open RFCs Context
┌───────────────────────┬─────────────┬──────────────────────────────────────────────┐
│ RFC │ Status │ Relevance │
├───────────────────────┼─────────────┼──────────────────────────────────────────────┤
│ 000-project-phases.md │ Implemented │ Design principles - foundational │
├───────────────────────┼─────────────┼──────────────────────────────────────────────┤
│ 001-abstractions.md │ Implemented │ Environment/Client abstractions │
├───────────────────────┼─────────────┼──────────────────────────────────────────────┤
│ 002-env-spec.md │ Implemented │ Environment specification │
├───────────────────────┼─────────────┼──────────────────────────────────────────────┤
│ 003-mcp-support.md │ Implemented │ MCP integration (not used by dm_control_env) │
└───────────────────────┴─────────────┴──────────────────────────────────────────────┘
No Draft or In Review RFCs that would conflict with dm_control_env.
Tier 1: Fixes Required
None identified. The dm_control_env code passes all automated checks.
Tier 2: Alignment Discussion
Principle Conflicts
None identified. The dm_control_env implementation follows OpenEnv principles:
┌────────────────────────────┬────────┬────────────────────────────────────────────────────────────────────┐
│ Principle │ Status │ Evidence │
├────────────────────────────┼────────┼────────────────────────────────────────────────────────────────────┤
│ Gymnasium-style API │ ✅ │ Uses reset(), step(), state │
├────────────────────────────┼────────┼────────────────────────────────────────────────────────────────────┤
│ Container isolation │ ✅ │ Has server/Dockerfile │
├────────────────────────────┼────────┼────────────────────────────────────────────────────────────────────┤
│ Type safety with generics │ ✅ │ Environment[DMControlAction, DMControlObservation, DMControlState] │
├────────────────────────────┼────────┼────────────────────────────────────────────────────────────────────┤
│ Pydantic serialization │ ✅ │ All models extend Action, Observation, State │
├────────────────────────────┼────────┼────────────────────────────────────────────────────────────────────┤
│ Rewards inside environment │ ✅ │ Reward from dm_control passed through, not computed externally │
├────────────────────────────┼────────┼────────────────────────────────────────────────────────────────────┤
│ Client-server separation │ ✅ │ client.py does not import from server/ │
└────────────────────────────┴────────┴────────────────────────────────────────────────────────────────────┘
RFC Conflicts
None identified. The dm_control_env is a standard environment implementation that:
Per RFC README: "You generally don't need an RFC for new example environments (unless they introduce new patterns)." dm_control_env follows existing patterns.
Invariant Check
┌──────────────────────────┬────────┬────────────────────────────────────┐
│ Invariant │ Status │ Notes │
├──────────────────────────┼────────┼────────────────────────────────────┤
│ Gymnasium API signatures │ ✅ │ Standard reset(), step(), state │
├──────────────────────────┼────────┼────────────────────────────────────┤
│ Generic type safety │ ✅ │ Proper generic types used │
├──────────────────────────┼────────┼────────────────────────────────────┤
│ Pydantic serialization │ ✅ │ All wire types are Pydantic models │
├──────────────────────────┼────────┼────────────────────────────────────┤
│ Agent isolation │ ✅ │ No MCP tools exposing reset/step │
├──────────────────────────┼────────┼────────────────────────────────────┤
│ Container isolation │ ✅ │ Dockerfile provided │
├──────────────────────────┼────────┼────────────────────────────────────┤
│ Client-server separation │ ✅ │ No cross-imports │
├──────────────────────────┼────────┼────────────────────────────────────┤
│ Rewards in environment │ ✅ │ Uses dm_control's native reward │
└──────────────────────────┴────────┴────────────────────────────────────┘
Summary
Verdict: READY FOR REVIEW - The dm_control_env follows all OpenEnv principles and invariants. It is a standard environment implementation without any architectural deviations.