Skip to content

feat: swe with any harness - #2011

Merged
cmunley1 merged 8 commits into
mainfrom
cmunley1/anyswe2
Jul 30, 2026
Merged

feat: swe with any harness#2011
cmunley1 merged 8 commits into
mainfrom
cmunley1/anyswe2

Conversation

@cmunley1

@cmunley1 cmunley1 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

anyswe_agent

Update for #1572 to use sandbox api

Runs any Gym agent inside a SWE-style task container and evaluates the resulting
git diff HEAD patch with the dataset harness. Works with hermes_agent,
claude_code_agent, or another compatible Gym agent.

Quickstart

From the repo root, create env.yaml for the policy model server:

policy_base_url: http://localhost:10240/v1
policy_api_key: EMPTY
policy_model_name: nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16

Prepare 5 examples (tasks+images):

python responses_api_agents/anyswe_agent/prepare.py --limit 5

Start the environment:

ng_run "+config_paths=[responses_api_agents/anyswe_agent/configs/anyswe_hermes.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" \
  ++anyswe_hermes.responses_api_agents.anyswe_agent.container_formatter='responses_api_agents/anyswe_agent/data/sifs/{instance_id}.sif'

Collect rollouts:

ng_collect_rollouts \
  +agent_name=anyswe_hermes \
  +input_jsonl_fpath=responses_api_agents/anyswe_agent/data/swebench_verified.jsonl \
  +output_jsonl_fpath=results/anyswe_rollouts.jsonl \
  +limit=5

Each rollout row contains reward, the full trajectory, and mask_sample for
timeouts or unreliable rewards.

Agent wiring

Point the config at the Gym agent server:

agent_server_module: responses_api_agents.hermes_agent.app
agent_server_class: HermesAgent
agent_config_class: HermesAgentConfig
agent_kwargs: {max_turns: 100, terminal_backend: local}

Agent dependencies install once at startup into a portable prefix mounted inside
the task container. Add setup_scripts/<agent_dir>_deps.sh for new agents.

Dataset and images

prepare.py writes data/swebench_verified.jsonl and builds
data/sifs/{instance_id}.sif.

python responses_api_agents/anyswe_agent/prepare.py

Image builds require apptainer, network access to the SWE-bench registry, and
substantial disk space. Use --limit and --jobs N while iterating. Dataset
prep requires pip install datasets.

Supported datasets: SWE-bench, SWE-bench Multilingual, R2E-Gym.

@copy-pr-bot

copy-pr-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ritaneves
ritaneves requested a review from Glorf July 16, 2026 10:16
@ritaneves

Copy link
Copy Markdown
Contributor

Assigning @Glorf for the sandbox API

@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Jul 17, 2026
Glorf
Glorf previously approved these changes Jul 24, 2026

@Glorf Glorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The overall structure of this implementation looks sound to me. I'd recommend merging it as-is (as a boilerplate) and run the exact accuracy scores alignment with prior implementations/vs the leaderboards as a fast follow-up

@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Jul 24, 2026
@adil-a adil-a linked an issue Jul 27, 2026 that may be closed by this pull request
@cmunley1
cmunley1 changed the base branch from main to cmunley1/agent-model-config July 29, 2026 03:41
Base automatically changed from cmunley1/agent-model-config to main July 29, 2026 22:49
bxyu-nvidia
bxyu-nvidia previously approved these changes Jul 29, 2026
cmunley1 added 8 commits July 29, 2026 21:24
Signed-off-by: Christian Munley <cmunley@nvidia.com>
Signed-off-by: Christian Munley <cmunley@nvidia.com>
Signed-off-by: Christian Munley <cmunley@nvidia.com>
Signed-off-by: Christian Munley <cmunley@nvidia.com>
Signed-off-by: Christian Munley <cmunley@nvidia.com>
Signed-off-by: Christian Munley <cmunley@nvidia.com>
Signed-off-by: Christian Munley <cmunley@nvidia.com>
Signed-off-by: Christian Munley <cmunley@nvidia.com>
@cmunley1
cmunley1 merged commit 72ef928 into main Jul 30, 2026
9 checks passed
@cmunley1
cmunley1 deleted the cmunley1/anyswe2 branch July 30, 2026 04:53
OlegSudakov pushed a commit to OlegSudakov/Gym that referenced this pull request Aug 7, 2026
# anyswe_agent

Update for NVIDIA-NeMo#1572 to use sandbox api 

Runs any Gym agent inside a SWE-style task container and evaluates the
resulting
`git diff HEAD` patch with the dataset harness. Works with
`hermes_agent`,
`claude_code_agent`, or another compatible Gym agent.

# Quickstart

From the repo root, create `env.yaml` for the policy model server:

```yaml
policy_base_url: http://localhost:10240/v1
policy_api_key: EMPTY
policy_model_name: nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16
```

Prepare 5 examples (tasks+images):

```bash
python responses_api_agents/anyswe_agent/prepare.py --limit 5
```

Start the environment:

```bash
ng_run "+config_paths=[responses_api_agents/anyswe_agent/configs/anyswe_hermes.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" \
  ++anyswe_hermes.responses_api_agents.anyswe_agent.container_formatter='responses_api_agents/anyswe_agent/data/sifs/{instance_id}.sif'
```

Collect rollouts:

```bash
ng_collect_rollouts \
  +agent_name=anyswe_hermes \
  +input_jsonl_fpath=responses_api_agents/anyswe_agent/data/swebench_verified.jsonl \
  +output_jsonl_fpath=results/anyswe_rollouts.jsonl \
  +limit=5
```

Each rollout row contains `reward`, the full trajectory, and
`mask_sample` for
timeouts or unreliable rewards.

# Agent wiring

Point the config at the Gym agent server:

```yaml
agent_server_module: responses_api_agents.hermes_agent.app
agent_server_class: HermesAgent
agent_config_class: HermesAgentConfig
agent_kwargs: {max_turns: 100, terminal_backend: local}
```

Agent dependencies install once at startup into a portable prefix
mounted inside
the task container. Add `setup_scripts/<agent_dir>_deps.sh` for new
agents.

# Dataset and images

`prepare.py` writes `data/swebench_verified.jsonl` and builds
`data/sifs/{instance_id}.sif`.

```bash
python responses_api_agents/anyswe_agent/prepare.py
```

Image builds require `apptainer`, network access to the SWE-bench
registry, and
substantial disk space. Use `--limit` and `--jobs N` while iterating.
Dataset
prep requires `pip install datasets`.

Supported datasets: SWE-bench, SWE-bench Multilingual, R2E-Gym.

---------

Signed-off-by: Christian Munley <cmunley@nvidia.com>
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.

Decouple SWE environment infrastructure from agent harnesses

4 participants