Skip to content

feat: add gym-anything (CUA-World) environment adapter - #17

Open
dzorlu wants to merge 1 commit into
deniz/fleet_clientfrom
feat/gym-anything-adapter
Open

feat: add gym-anything (CUA-World) environment adapter#17
dzorlu wants to merge 1 commit into
deniz/fleet_clientfrom
feat/gym-anything-adapter

Conversation

@dzorlu

@dzorlu dzorlu commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds GymAnythingEnvClient wrapping gym-anything's 250+ Docker-based desktop software environments as an OpenEnv-compatible environment
  • Provides reset_async()/step_async() with screenshot observations, coordinate scaling, and programmatic verifier rewards
  • Compatible with existing Fleet computer_use pipeline (same tool/observation format)

Test plan

  • Smoke test with one environment (e.g., gimp_all_fast_env)

🤖 Generated with Claude Code

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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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_async and included it in the done condition so episodes now terminate when _step_count reaches max_steps.

Create PR

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4bcd4ac. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant