Skip to content

Add NeMo Gym V1 integration - #2212

Open
xeophon wants to merge 27 commits into
mainfrom
agent/nemo-gym-v1
Open

Add NeMo Gym V1 integration#2212
xeophon wants to merge 27 commits into
mainfrom
agent/nemo-gym-v1

Conversation

@xeophon

@xeophon xeophon commented Jul 31, 2026

Copy link
Copy Markdown
Member

Overview

Adds a NeMo Gym resources-server integration for Verifiers V1. Existing Verifiers harnesses drive the rollout while NeMo Gym remains responsible for resource-server state, native tools, and scoring.

Details

  • Loads NeMo Gym JSONL requests into typed V1 tasks and preserves the source row for session setup and verification.
  • Carries per-rollout cookies and signed MCP session headers through V1 state while exposing upstream tool schemas to MCP-capable harnesses.
  • Converts completed single-branch traces into NeMo Responses objects and records /verify rewards and numeric metrics.
  • Adds a Python 3.12+ nemo-gym optional dependency and reuses resource-server classes from the published package, with V1 owning startup and cleanup.
  • Uses uv dependency metadata to install only the resource-server import slice instead of the full NeMo agent, model, and evaluation stack.
  • Adds environments/nemo_gym_weather_v1 as a thin, self-starting example package; external resource-server URLs remain supported for custom deployments.

Fixes RES-1090


Note

Medium Risk
New subprocess lifecycle, HTTP/MCP session bridging, and a large optional dependency graph (Ray, wandb, etc.) on 3.12+; core 3.11 installs are gated but lockfile/resolution changes affect all developers.

Overview
Adds NeMo Gym as a V1 taskset path so harnesses can run rollouts against Gym resource servers while scoring stays on Gym’s /verify API.

The new verifiers/v1/tasksets/nemo_gym package loads JSONL rows into tasks, seeds per-rollout sessions (cookies + optional MCP metadata), bridges tools via NeMoGymToolset (upstream MCP or direct HTTP), and converts a single-branch trace to a NeMo Responses payload for verification. NeMoGymEnv can spawn a published resource-server class in a subprocess when no resources_url is set.

Packaging: optional nemo-gym extra (Python 3.12+) with uv dependency-metadata to trim NeMo’s declared stack to resource-server needs; lockfile picks up transitive deps. Example package environments/nemo_gym_weather_v1 pins the example MCP weather server and dataset. MCP server registration is renamed from _register to register on the base server/toolset.

CI smoke evals skip nemo_gym_weather_v1 because it is not in the default install.

Reviewed by Cursor Bugbot for commit 0e1a385. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add NeMo Gym V1 integration for agent evaluation against managed resource servers

  • Adds NeMoGymTaskset and NeMoGymEnv in verifiers/v1/tasksets/nemo_gym/ to load tasks from a JSONL dataset, seed sessions with a NeMo Gym resource server, and score rollouts via the server's /verify endpoint.
  • NeMoGymEnv.start automatically spawns a per-worker resource server subprocess, polls for its port, and wires the task config to use it; NeMoGymEnv.stop tears it down cleanly.
  • NeMoGymToolset proxies list_tools and call_tool to the upstream MCP server when available, or falls back to direct HTTP POSTs for datasets that declare tools explicitly.
  • trace_to_nemo_response converts a completed Verifiers trace into a NeMo Gym-compatible response payload for submission to /verify.
  • Adds the nemo-gym-weather-v1 example environment package in environments/nemo_gym_weather_v1/ demonstrating how to wire a concrete taskset to a resource server.

Changes since #2212 opened

  • Changed NeMoGymTask.setup method to remove transport validation and default values when processing MCP metadata [3865703]
  • Refactored NeMoGymTask.nemo_gym reward method to change verification result processing [3865703]
  • Fixed server.main function module name parsing to handle modules without dots [3865703]
  • Removed NeMoGymState and NeMoGymToolset exports from nemo_gym.__init__ module [3865703]
  • Removed from __future__ import annotations imports and inlined port file path construction [3865703]
  • Modified test infrastructure to skip nemo_gym_weather_v1 taskset and remove editable overlay support from eval commands [0e1a385]
  • Changed Python version environment marker for nemo-gym optional dependency [0e1a385]

Macroscope summarized 9cbd5c2.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@xeophon
xeophon requested a review from anravich13-cloud July 31, 2026 19:26
@xeophon

xeophon commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

Migrated review context

This PR carries the exact head commit from the prior fork-backed review. Outstanding point retained for follow-up:

  • Normalize Codex-qualified MCP tool names back to the original NeMo Gym tool name before sending the trace to /verify.

Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/server.py
@macroscopeapp

macroscopeapp Bot commented Jul 31, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

This PR introduces a new NeMo Gym V1 integration with substantial new capabilities including subprocess management for resource servers, HTTP/MCP communication with external services, and new scoring mechanisms. The scope and complexity of this new feature warrants human review.

You can customize Macroscope's approvability policy. Learn more.

@xeophon
xeophon force-pushed the agent/nemo-gym-v1 branch 2 times, most recently from 44df475 to 3cc18e5 Compare August 3, 2026 08:46
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread docs/v1/nemo_gym.md Outdated
Comment thread tests/v1/test_envs.py Outdated
Comment thread verifiers/v1/mcp/launch.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated
Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py Outdated

@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 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d102c94. Configure here.

Comment thread verifiers/v1/tasksets/nemo_gym/taskset.py
Comment thread verifiers/v1/tasksets/nemo_gym/response.py
Comment thread verifiers/v1/tasksets/nemo_gym/toolset.py
@xeophon
xeophon force-pushed the agent/nemo-gym-v1 branch from e80ec39 to 9cbd5c2 Compare August 5, 2026 14:17
Comment thread verifiers/v1/tasksets/nemo_gym/server.py Outdated
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.

2 participants