Skip to content

feat(deepcad): run five harnesses through shared agent sessions - #6254

Merged
yfw merged 28 commits into
NVIDIA-NeMo:mainfrom
gerryche123:tongc/multi-harnesses-support-for-rl-tasks
Nov 20, 2026
Merged

yfw merged 28 commits into
NVIDIA-NeMo:mainfrom
gerryche123:tongc/multi-harnesses-support-for-rl-tasks

Conversation

@gerryche123

@gerryche123 gerryche123 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a CAD recipe composing OpenCode, Pi, Codex, Claude Code and OpenClaw with the shared resources server and final-file geometry verifier from #5950. #5720 is the composition reference. No separate issue is needed for this incremental onboarding work.

The change is confined to resources_servers/deepcad/. It does not change Gym core, other tasks' agents, or other tasks' policy settings.

  • CAD-specific agent names and deepcad_policy_model reuse the stock agent implementations.
  • There is no Gym-level model-call cap. The original CAD limit of 10 is OpenCode's own build.steps; each harness's own turn limit and the episode's agent_timeout_sec bound a run. Codex, Pi and OpenClaw have no native turn limit, so only the timeout bounds them.
  • Image delivery uses each harness's existing support: OpenCode, Pi and OpenClaw take image_input: true, Codex sends input_image, and Claude Code reads the PNG files itself. Tool-output images are enabled on the CAD model.
  • Hermes and NOOA are not part of this recipe. Hermes' vision tool is not qualified in Gym and NOOA passes only text, so each needs its own image path and a real-model smoke run before it can be added.
  • Prepared rows retain source sampling without requiring a sampling marker on every request. File-input activations are text-only workspace paths; reference geometry stays isolated from the agent.
  • Existing task inputs, geometry scorer and native harness loops are reused.

Validation

Head: 67e3329a7.

  • DeepCAD component suite in its own environment: 323 passed, 3 skipped. ruff check and ruff format --check on resources_servers/deepcad: pass.
  • Everything outside resources_servers/deepcad/ is identical to main.
  • Real-model smoke (5 original examples × 5 harnesses = 25 episodes, one real checkpoint, OpenSandbox, commit a7706529e; the later commits change docs and remove the unused rollout_correlation key from configs/opencode.yaml). All 25 ended with the final file collected and a verifier result.
Harness Episodes Mean reward Episodes where 3+ distinct images reached the model
claude_code 5 1.000 5 of 5
openclaw 5 1.000 5 of 5
codex 5 0.913 (one episode 0.562) 5 of 5
opencode 5 0.893 (one episode 0.466) 4 of 5
pi 5 1.000 3 of 5

Over all 25: mean reward 0.961, standard error 0.027.

Limits of this evidence, also written in OPENCODE.md:

  • Rewards are near 1.0 on these examples, so they do not separate harnesses. Two Pi episodes and one OpenCode episode never showed an image to the model, and the two Pi episodes still scored 1.0.
  • File-input rows carry no image in the first request; images arrive when the harness reads the workspace files, so delivery is counted over every captured request.
  • Comparison with the original single-harness recipe: see below. OPENCODE.md was written before it ran, so its statement that no comparison was run is superseded by this section.
  • Not training evidence: only 2 of 25 episodes passed NeMo RL's token-capture selection; the verifier results were read from the results NeMo RL retains when selection fails.
  • Cluster deviations from this recipe's defaults: the verifier ran from a copy of the CadQuery image whose default user is root (OpenSandbox's executor cannot switch users, and sealing runs as root), and the sandbox create timeout was 600 s (a first create took about three minutes). The first pass left 5 episodes without a result because their sandboxes stayed Pending; those 5 were run again and all finished.

Comparison with the OpenCode inline-image baseline

Baseline: the standalone OpenCode recipe (images inline in the prompt, no file input), same checkpoint, same 5 examples, run after the table above. Three samples per example were requested, but each group stopped at the first sample NeMo RL's capture selection rejected, so one verifier result per example was retained: 5 episodes, rewards 0.5625, 0.4656, 1.0, 0.0 and 1.0, mean 0.606. The 0.0 is a run that never wrote model.py.

Each harness's mean reward against that baseline, paired by example (bootstrap over the 5 examples):

Harness Mean reward Relative change vs baseline 95% bootstrap CI
claude_code 1.000 +65% [+12%, +241%]
openclaw 1.000 +65% [+39%, +241%]
pi 1.000 +65% [+40%, +241%]
codex 0.913 +51% [0%, +400%]
opencode (file input) 0.893 +48% [0%, +48%]

No harness is below the baseline's mean, so none is more than 10% under it. This is weak evidence: 5 examples, one baseline sample per example, a baseline that includes one failed run, and wide intervals. It does not show the harnesses are better, only that none is measurably worse on these examples.

Remaining readiness checks

  • Full repository CI. External-contributor CI requires an authorized maintainer to approve the final SHA with /ok to test; local checks do not replace it.

No training-convergence or cross-harness parity claim is made.

Compatibility and benchmark impact

  • Regenerate manifests to use CAD-specific agent names; configure the deployment policy_model before the CAD recipe, which creates deepcad_policy_model.
  • Load the model config first, then the CAD recipe. CAD inherits stock agents under task-scoped names, so a profile that edits a stock agent block, such as benchmarks/hle/pi.yaml, also changes the CAD agent that inherits that block. CAD also sets the top-level sandbox block to Docker. Do not blend CAD with such a profile, or with a recipe that sets another sandbox provider. A blend with SWE-bench Verified OpenCode was checked in both orders.
  • The CAD INSTRUCTIONS text changes for every OpenCode row, standalone and lazy rows included.
  • Materialized rows move sampling fields into _ng_model_sampling. A row's output cap then applies as the smaller of the row's cap and the harness's own cap. Before, OpenCode refused a row cap below its own. Lazy rows keep the values in the request as well, so OpenCode still refuses a smaller cap there.
  • --file-input OpenCode rows have one user message with workspace paths and no system message. So system_prompt_mode: replace no longer replaces OpenCode's build prompt, and the CAD text becomes user text.
  • Inline targets remain in the explicit resource-seed target_images field. Lazy file-input conversion requires materialization first.
  • Geometry scoring and reference isolation remain unchanged. No quality or convergence parity is claimed.

@copy-pr-bot

copy-pr-bot Bot commented Nov 16, 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.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Nov 16, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers labels Nov 16, 2026
@yfw
yfw deleted the branch NVIDIA-NeMo:rohit/cad-rl November 17, 2026 17:13
@yfw yfw closed this Nov 17, 2026
@yfw yfw reopened this Nov 17, 2026
@yfw
yfw changed the base branch from rohit/cad-rl to main November 17, 2026 17:36
@yfw
yfw self-requested a review November 17, 2026 17:37
@gerryche123
gerryche123 marked this pull request as ready for review November 18, 2026 18:16
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Nov 18, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Nov 18, 2026

@yfw yfw 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.

HOLD. Two blockers: the generation budget never stops a harness (nemo_gym/models/rollout_budget.py:83-94), and test_harness_configs.py:80 turns the CI Server suite red.

Running one DeepCAD environment through seven stock agents with _copy environment servers is the shape Gym wants for multi-harness work. Routing, configuration keys, /ng-sampling/ and rollout correlation are correct for all seven harnesses. The merge with main kept the prepare_row and lazy-row behavior from #5950. With the budget off, nothing changes for other environments. After the fixes in the comments below, this recipe can be the reference example for one environment run by many harnesses.

Process:

  • No merge conflict with main now, so no rebase is needed.
  • DCO passes.
  • CI ran only DCO and the lock-freshness job. A maintainer needs to comment /ok to test with the full 40-character head SHA to start the other jobs.

Local runs (CPU only):

  • pre-commit passes with no rewrites.
  • deepcad tests in deepcad's own venv: 327 passed, 2 failed (see test_harness_configs.py:80), 4 skipped.
  • The PR's core budget tests: 11 of 11 pass. All model tests: 2308 passed.

Notes:

Generated by Claude Code

Comment thread nemo_gym/models/rollout_budget.py Resolved
@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Nov 18, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the risk:high Autobot PR risk: high label Nov 18, 2026
Carry the optional limit and explicit owning agent through existing correlation URLs. Reuse the shared atomic counter and native rollout stop, with the logical rollout ID shared across attempts. Uncapped episodes on the same model remain unaffected; CAD declares ten calls on its environment configuration.

Validation: 600 affected-suite tests passed with three optional skips; final 17 budget tests passed, including 6+4 retry accounting, independent samples, uncapped shared-model calls, sampling preservation and invalid request controls. Native client/runtime qualification remains pending.
Signed-off-by: Tong Che <[email protected]>
@gerryche123

Copy link
Copy Markdown
Contributor Author

Review fixes are pushed at c573165b758397010d23d4f76368565d27789567; the reusable generation-budget/stop changes are separately submitted in #6453. Eight review threads are addressed/resolved; the three native-run evidence threads remain open while final-head qualification runs.

The current head passes DCO, risk and lock-freshness checks. Copyright, Code linting and Secrets detector workflows report action_required, and full repository CI has not run. Could an authorized maintainer approve CI for this head using the repository trust-gate command /ok to test c573165b758397010d23d4f76368565d27789567? This is a request for maintainer authorization, not a claim that CI or native seven-harness qualification has passed.

@yfw yfw 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.

HOLD. This is a follow-up at c573165.

This PR and #6453 now conflict with main in one place. #6410, merged as 290641a, changed the same except in DockerProvider._run (provider.py L366-L373). On main, a cancelled command goes to kill_cancelled_command, which kills its process group and then waits for it with a shielded, bounded wait. Please resolve it in #6453 first. Keep main's two except blocks, and drop the isinstance(e, asyncio.CancelledError) check, which can then never be true:

            except asyncio.CancelledError:
                await kill_cancelled_command(proc)
                raise
            except asyncio.TimeoutError as e:
                with contextlib.suppress(ProcessLookupError):
                    os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
                with contextlib.suppress(Exception):
                    await proc.wait()
                raise TimeoutError(f"docker command timed out after {timeout_s:g}s: {_redact_argv(argv)}") from e

A local merge of main into this head with that change passes ruff and the Docker provider tests. The sandbox, agent, model, server-runtime, client and core unit tests pass and fail in the same places as on this head.

Since the last review, the test imports of Hermes and NOOA, tool-output images on the CAD model, OpenClaw image input, the sampling requirement, the config order in the test and the seed test are fixed. Thank you for the quick and careful fixes.

Still open:

  • Every DeepCAD episode fails at the agent seed with HTTP 404, before its first model call (single_agent_turn/app.py:618).
  • Tests fail in CI in three places: the Claude Code suite, the Hermes suite and one core sandbox-session test.
  • The HLE Pi blend that OPENCODE.md describes changes the CAD Pi agent.
  • The Hermes and NOOA image paths change shared code, and NOOA runs without the 10-call cap.
  • The real-model runs of the five tasks on the seven harnesses, which you track in the open threads.

Merge order: #6453 merges first. Then this PR needs a merge with main, so that its diff shows only the recipe and agent changes. Fixes in files that both PRs share (single_agent_turn/app.py, claude_code_agent/app.py, nooa_agent/app.py and the Docker provider) belong in #6453 first.

Process:

  • DCO passes.
  • CI ran only DCO, the risk check and the lock-freshness job. A maintainer needs to comment /ok to test with the full 40-character head SHA to start the other jobs.

Local runs (CPU only):

  • pre-commit passes with no rewrites.
  • deepcad tests in deepcad's own venv: 337 passed, 6 skipped. The extra skip is an OSMesa test that this machine cannot run.
  • Model tests and the stop test: 2359 passed, 4 skipped. single_agent_turn: 292 passed.
  • claude_code_agent: 4 failed, 246 passed. hermes_agent: 3 failed, 412 passed. On main alone, both suites pass.

Generated by Claude Code

Comment thread resources_servers/deepcad/OPENCODE.md Resolved
gerryche123 and others added 2 commits November 19, 2026 12:10
…nges

Drop the per-episode generation budget, stop lifecycle, Docker upload
semaphore and the Hermes/NOOA image plumbing. The recipe now only composes
the stock agent configs, as the Agentic-MME and collab_intel recipes do, and
documents which harnesses deliver images with their existing options.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Tong Che <[email protected]>
@gerryche123

Copy link
Copy Markdown
Contributor Author

Thanks, all addressed in 7776f8e.

  • Dropped the generation budget, stop wiring, Docker upload change, and the Hermes/NOOA image paths and converter change. The diff vs main is now only resources_servers/deepcad/ (8 files, +690/-102), and shared code is identical to main. The 404 at the agent seed is gone with it.
  • feat(episodes): enforce generation budgets across rollout retries #6453 is no longer a dependency, and the Docker _run conflict with fix(sandbox): shield and bound AsyncSandbox.stop and the other releases #6410 disappears too.
  • The 10-call limit was OpenCode's max_steps, not part of the score. Codex, Pi and OpenClaw have no native turn limit, so only agent_timeout_sec bounds them. This is documented in OPENCODE.md.
  • Images: OpenCode, Pi and OpenClaw use their existing image_input, and Codex sends input_image. Hermes, NOOA and Claude Code have no image option on main, so the recipe states they are not qualified for this vision task. OPENCODE.md says this.
  • Tests: deepcad suite 330 passed, 5 skipped; ruff passes.

Still open: the real-model runs on the five tasks. The sandbox pulls a private image and I'm moving it to a registry the cluster can pull. I will not claim seven qualified pairings before those results exist. I'll resolve the stale threads once those results are in.

…e the target images

Remove Hermes and NOOA until each has an image path and a real-model smoke
run, restore the Docker image to main, and document that a profile editing a
stock agent block must not be blended with CAD. The blend test now compares
the whole CAD agent block with its CAD-only resolve.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Tong Che <[email protected]>
@gerryche123 gerryche123 changed the title feat(deepcad): run seven harnesses through shared agent sessions feat(deepcad): run five harnesses through shared agent sessions Nov 19, 2026
yfw
yfw previously approved these changes Nov 20, 2026
Comment thread nemo_gym/models/rollout_budget.py Resolved
Comment thread resources_servers/deepcad/OPENCODE.md Resolved
@yfw

yfw commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

/ok to test 6aa9e24

@yfw
yfw enabled auto-merge November 20, 2026 02:05
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 20, 2026 02:06
…cipe

The recipe drives agents through episode sessions, which take the rollout ID from the seed, so the key
only changed other benchmarks that load with it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Tong Che <[email protected]>
auto-merge was automatically disabled November 20, 2026 04:25

Head branch was pushed to by a user without write access

@yfw

yfw commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

/ok to test 67e3329

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44773852146

Merged via the queue into NVIDIA-NeMo:main with commit 7cb3ae3 Nov 20, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers community-request Issue reported or requested by someone from the community feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants