feat: nemo gym integration#1053
Conversation
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
…t name, use endpoint params, rename packages to hyphens, update readme, ruff Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
| tool_call = ToolCall( | ||
| id=str(item.get("call_id") or item.get("id") or uuid.uuid4().hex[:8]), | ||
| name=str(item.get("name", "")), | ||
| arguments=str(item.get("arguments", "{}")), |
There was a problem hiding this comment.
Tool call arguments may produce invalid JSON
Medium Severity
_nemo_item_to_assistant_message uses str() to convert the arguments field of a function call item, but ToolCall.arguments is expected to be a valid JSON string throughout the codebase. If NeMo Gym returns arguments as a dict, str() produces Python repr (e.g., "{'key': 'value'}") instead of valid JSON ('{"key": "value"}'). Multiple consumers in the codebase call json.loads(tool_call.arguments) (in tool_env.py, stateful_tool_env.py, etc.), which would fail on Python repr format. The existing _normalize_raw_tool_calls in message_utils.py handles this correctly by checking isinstance(arguments, str) first and falling back to json.dumps().
Reviewed by Cursor Bugbot for commit 8145b83. Configure here.
Signed-off-by: cmunley1 <cmunley@nvidia.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bb22743. Configure here.
| - **`ReasoningGymEnv`** — wraps [reasoning-gym](https://github.com/open-thought/reasoning-gym) procedural datasets | ||
| - **`BrowserEnv`** — unified browser automation via [Browserbase](https://browserbase.com) with DOM and CUA modes | ||
| - **`OpenEnvEnv`** — wraps OpenEnv gym and MCP contracts using Prime Sandboxes with prebuilt images referenced from `.build.json` | ||
| - **`NemoGymEnv`** — wraps [NVIDIA NeMo Gym](https://github.com/NVIDIA-NeMo/Gym) environments. |
There was a problem hiding this comment.
NemoGymEnv install instructions missing from docs
Low Severity
NemoGymEnv is added to the integrations list but the follow-up install paragraph at line 794 only mentions extras for TextArena, BrowserEnv, and OpenEnvEnv. Since NemoGymEnv requires a different install flow (editable local clone, no pip extra defined in pyproject.toml), users reading "These require additional dependencies installed via extras" will be confused about how to install the NeMo Gym dependency.
Triggered by project rule: BugBot Instructions
Reviewed by Cursor Bugbot for commit bb22743. Configure here.


Description
Integrates NVIDIA NeMo Gym with a few example environments. Entire multiturn rollout is offloaded to nemo gym through the rollout collection helper in nemo gym, which includes agent, model, and resources servers.
Example usage
Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
Note
Medium Risk
Introduces a new async/threaded integration that starts and manages external NeMo Gym servers and maps their rollouts into Verifiers state, plus expands local install path resolution; these changes touch execution lifecycle and environment installation behavior.
Overview
Adds NVIDIA NeMo Gym integration via a new
NemoGymEnvthat delegates rollouts to NeMo Gym’s rollout collection helper, manages head/policy server configuration and lifecycle, and converts NeMo Gym results into Verifierstrajectory/completionplus a reward sourced from NeMo Gym.Adds multiple example NeMo Gym environment packages under
environments/nemo_gym/*(each exposingload_environment()andpyproject.tomlmetadata) and updates docs/README and tests to reference the new integration and skip the parentnemo_gymdirectory.Improves tooling compatibility by letting
install_from_local()discover environments one directory deeper (nested underenvironments/*/<env_name>) and treating raw messages with roledeveloperassystemin message normalization.Reviewed by Cursor Bugbot for commit bb22743. Bugbot is set up for automated code reviews on this repo. Configure here.