feat: add gym-anything (CUA-World) environment adapter - #17
Conversation
Adds GymAnythingEnvClient wrapping gym-anything's 250+ Docker-based desktop software environments (Blender, GIMP, LibreOffice, etc.) as an OpenEnv-compatible environment for computer-use agent evaluation and training. Provides reset_async/step_async with screenshot observations, coordinate scaling (Qwen VL [0,1000] → pixel), and programmatic verifier rewards. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Step count tracked but max_steps never enforced
- Added a max-step check in
step_asyncand included it in the done condition so episodes now terminate when_step_countreachesmax_steps.
- Added a max-step check in
Or push these changes by commenting:
@cursor push a858d8aac1
Preview (a858d8aac1)
diff --git a/src/envs/gym_anything_env/client.py b/src/envs/gym_anything_env/client.py
--- a/src/envs/gym_anything_env/client.py
+++ b/src/envs/gym_anything_env/client.py
@@ -122,6 +122,7 @@
async def step_async(self, action: Dict[str, Any]) -> Tuple[Dict, float, bool, Dict]:
"""Execute action, return (obs, reward, done, info)."""
self._step_count += 1
+ max_steps_reached = self._step_count >= self.max_steps
is_done = action.get("done", False)
tool_name = action.get("tool", "")
@@ -148,11 +149,13 @@
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{screenshot}"}}
]
+ done = done or is_done or max_steps_reached
+
# Normalize reward from 0-100 to 0-1
if done and "verifier" in info:
reward = info["verifier"].get("score", 0) / 100.0
- return observation, reward, done or is_done, info
+ return observation, reward, done, info
def close(self):
if self.ga_env:This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4bcd4ac. Configure here.
| if done and "verifier" in info: | ||
| reward = info["verifier"].get("score", 0) / 100.0 | ||
|
|
||
| return observation, reward, done or is_done, info |
There was a problem hiding this comment.
Step count tracked but max_steps never enforced
Medium Severity
max_steps is accepted as a constructor parameter and _step_count is incremented every step_async call, but the step count is never compared against max_steps to terminate the episode. The analogous fleet_env task_env.py correctly checks self._step_count >= self.max_steps and sets done accordingly. Without this check, the environment never signals completion due to exceeding the step limit, potentially causing infinite agent loops.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4bcd4ac. Configure here.



Summary
GymAnythingEnvClientwrapping gym-anything's 250+ Docker-based desktop software environments as an OpenEnv-compatible environmentreset_async()/step_async()with screenshot observations, coordinate scaling, and programmatic verifier rewardsTest plan
gimp_all_fast_env)🤖 Generated with Claude Code