Skip to content

fix(config): preserve environment server references when agents are renamed - #4141

Merged
ananthsub merged 3 commits into
NVIDIA-NeMo:mainfrom
zyzhou5:fix-environment-server-agent-renames
Oct 7, 2026
Merged

ananthsub merged 3 commits into
NVIDIA-NeMo:mainfrom
zyzhou5:fix-environment-server-agent-renames

Conversation

@zyzhou5

@zyzhou5 zyzhou5 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Keep Environment Server references valid when _inherit_from renames an agent. For example, NeMo-RL's existing litmus_agent_agent → rdkit_chemistry_agent rename now updates the existing wrapper's agent reference automatically, allowing the original RL configs to load without additional overrides.

No separate issue was opened because this PR directly fixes the existing NeMo-RL configuration regression described above.

Compatibility

  • scripts/add_legacy_agent_environment_servers.py leaves supported agent renames to Gym instead of writing blocks for them, and exits with 2 only for unreadable files.
  • AmbiguousAgentRenameError reports when an agent is inherited into several agent instances and an Environment Server still references the old name.
  • Configs migrated by the previous script still load with the same Environment Servers.

Validation

Model rollouts: N/A; this PR changes configuration resolution and migration tooling, with no changes to agent, model, or verifier execution code.

On the latest revision, aecdabb98:

  • Config tests: 210 passed; migration-script tests: 27 passed. Coverage includes non-agent destinations, ambiguous renames, inherited wrappers with strict configuration enabled, and configs produced by the previous migration script.
  • pre-commit run --all-files, git diff --check, and Fern documentation validation: passed.

On the previous revision, 6ea211bdb:

  • Migration, task materialization, benchmark, and rollout collection tests: 565 passed.
  • Offline resolution of three unchanged Ultra configs matched main with the explicit RL overrides. Four other RL recipes retained identical resolved configs, including SWE automatic fallback and the mixed training recipe.

@zyzhou5 zyzhou5 added bug Something isn't working area:config Hydra configuration, schemas, composition, and compatibility needs-review PR is ready for code review and waiting on a reviewer labels Oct 6, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 6, 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.

@zyzhou5
zyzhou5 requested a review from ananthsub October 6, 2026 22:25
@zyzhou5
zyzhou5 force-pushed the fix-environment-server-agent-renames branch from af612a5 to 6ea211b Compare October 6, 2026 22:42
@ananthsub ananthsub added the r0.7.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge. label Oct 6, 2026
Comment thread nemo_gym/global_config.py Resolved
Comment thread nemo_gym/global_config.py Resolved
Comment thread nemo_gym/global_config.py Resolved
Comment thread tests/unit_tests/test_global_config.py Resolved
Comment thread tests/unit_tests/test_global_config.py Resolved
@ananthsub

ananthsub commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This PR changes what an _inherit_from rename means in Gym, so it should also update everything else that handles renames. Please expand its scope to the full migration and backward compatibility story, rather than landing the parser change alone.

With only the parser change, Gym gives a user two different answers for the same config:

flowchart LR
    C["A config that renames an agent with _inherit_from"]
    P["Config parser<br/>follows the rename (this PR)"]
    M["Migration script<br/>still rewrites renames, exits with 2 for some"]
    H["ServerRefNotFoundError hint<br/>still says to run the script"]
    D["Troubleshooting docs<br/>still describe the manual process"]
    W["Agent swaps<br/>update routing and rows, renames do not"]
    C --> P
    C --> M
    C --> H
    C --> D
    C --> W
    classDef done fill:#E1F5EE,stroke:#0F6E56,color:#085041
    classDef todo fill:#FAECE7,stroke:#993C1D,color:#712B13
    class P done
    class M,H,D,W todo
Loading
  • The parser loads a rename that sits in the same file as its server, but scripts/add_legacy_agent_environment_servers.py --check rejects that same file and exits with 2.
  • The ServerRefNotFoundError hint and the troubleshooting page tell users to point servers at the new name by hand or with the script, which is no longer needed.
  • Agent swaps also update routing settings and rows that use the old name. Renames only update environment servers.

What the complete change covers

  • Parser: renames and swaps share one follow-up step that updates environment servers, routing settings, rows, and dataset agent: pins. Ambiguous renames get a specific error. The inline comments on nemo_gym/global_config.py and tests/unit_tests/test_global_config.py describe this part.
  • Migration script: it declares servers only for agents that no server references, and leaves renames to Gym.
  • Error hint and docs: they describe the new behavior.
  • Backward compatibility: existing configs keep loading and resolve the same.

Backward compatibility to preserve and test

  • Benchmark configs: 144 config files under benchmarks/ rename an agent and declare their own server for the new name. Every benchmark should resolve to the same agent and environment servers as on main, and gym eval list --json output should not change. The only expected difference in the resolved config is the added agent_map entries.
  • Several benchmarks in one run: loading two benchmark configs that rename the same agent must keep working, because nothing still names the old agent.
  • Configs already migrated with feat(config): support environment servers that front several agents #4053's script: those configs contain blocks that point a server at the new name, or a renamed agent's server that inherits the source's generated server. They must still load, with the same servers, after this PR. Please add a test that parses the output of the current script on main for each rename case it handles.
  • Configs that load today: rewriting dataset pins and adding agent_map entries only changes configs that used the old name, which failed before. A config that loads on main should resolve the same after this PR, apart from the added agent_map entries.

The migration script should leave renames to Gym

scripts/add_legacy_agent_environment_servers.py handles renames itself. In stanzas_for:

  • When a declared server references the source agent, the script appends a block that points the reference at the new name.
  • When that server is in the same file as the rename, appending would repeat the server's key. The script prints "update by hand" and exits with 2.
  • When the source only has the server the script would generate, the renamed agent gets a server that inherits it, through the INHERITED template.

With Gym following renames, none of this is needed. The "update by hand" case is now wrong: Gym loads that config as written, but --check still exits with 2.

Please reduce the script to one job: declare a server for each agent that no environment server references. An agent instance that inherits from another agent gets nothing, because Gym points the source's server at it.

flowchart TD
    A["Agent instance in a config file"]
    B{"Does an environment server already reference it?"}
    C{"Does it inherit from another agent with _inherit_from?"}
    D{"Unbound template, or an overlay with no entrypoint?"}
    S1["Skip"]
    S2["Skip<br/>Gym points the source's server at the new name"]
    S3["Skip"]
    Z["Append a legacy_agent environment server block"]
    A --> B
    B -->|"yes"| S1
    B -->|"no"| C
    C -->|"yes"| S2
    C -->|"no"| D
    D -->|"yes"| S3
    D -->|"no"| Z
    classDef removed fill:#FAECE7,stroke:#993C1D,color:#712B13
    class S2 removed
Loading

The highlighted branch replaces the script's rename handling:

  • In stanzas_for, skip any instance whose _inherit_from names a known agent. Remove the retargeted blocks and the unmigrated list.
  • In server_names_for, leave those instances out, so the script never declares a second server for a renamed agent. A second server would make agent-routed rows ambiguous.
  • Remove the INHERITED template and the generated mapping that only feeds it.
  • Keep exit code 2 for unreadable files only, and drop "updates by hand" from the summary line.
  • Rewrite the module docstring's rename section to say that Gym follows renames.

A source agent with no server anywhere still works. If the script runs on the source's file, the source gets a server and Gym points it at the new name. Otherwise Gym generates a legacy_agent relay for the renamed agent, or reports it under error_on_agent_without_environment_server.

Update these tests in tests/unit_tests/test_add_legacy_agent_environment_servers.py:

  • test_rename_points_the_declared_server_at_the_new_name: the script appends nothing, and the config parses with the declared server fronting the renamed agent.
  • test_migrated_rename_parses_with_one_server: the rename overlay stays unchanged, and the renamed agent is fronted by the source's server in all three cases.
  • test_migrated_renames_point_a_multi_agent_server_at_the_new_names: the overlay stays unchanged, and both agents of my_conversation follow their renames.
  • test_reports_a_rename_beside_the_server_it_would_retarget: the script exits with 0, leaves the file unchanged, and the file parses with strict=True.

Error hint and documentation

  • The ServerRefNotFoundError hint in validate_and_populate_defaults says that if the agent was renamed, "this environment server must reference the agent's new name", and suggests running the migration script. After this change, a dangling agent reference comes only from inheritance Gym cannot follow: nested _inherit_from, or a new entry that is no longer exactly one agent. Please say that, and drop the script suggestion.
  • fern/versions/latest/pages/troubleshooting/configuration.mdx describes the script's rename handling and says the script exits with 2 when "a rename needs a manual update". Please replace that paragraph. It should say that Gym points environment servers, routing, rows, and dataset pins at the new name, and that renaming one agent to two names fails if anything still names it. Keep the sentence about not adding a second server.
  • The example in fern/versions/latest/pages/evaluation/benchmarks.mdx renames math_with_judge_simple_agent without declaring a server. It now loads as written, so it needs no change.

PR description

Please add:

  • This PR replaces the rename handling from feat(config): support environment servers that front several agents #4053 in the parser, the migration script, the error hint, and the troubleshooting page.
  • Compatibility: dataset pins naming a renamed or swapped agent are rewritten. Resolved configs gain agent_map entries from old to new names. The migration script no longer writes blocks for renames, and no longer exits with 2 for them.

@yaoyu-33 yaoyu-33 added the complexity:low Localized change in one scope with a small, straightforward review surface label Oct 6, 2026
@zyzhou5

zyzhou5 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the issues related to the legacy wrapper path raised by @ananthsub . Broader renaming logic change could use a separate PR.

@zyzhou5

zyzhou5 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ad34eac

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 7, 2026 03:41
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Comment thread nemo_gym/global_config.py Resolved
Comment thread nemo_gym/global_config.py Resolved
@ananthsub

Copy link
Copy Markdown
Contributor

Thanks for narrowing the scope. This update covers what the parser change left inconsistent: the migration script no longer rewrites renames or exits with 2 for them, ambiguous renames get their own error, and the hint and troubleshooting page describe the new behavior.

Benchmark resolution is unchanged. All 144 config files under benchmarks/ resolve to the same config on main and with this PR merged into current main.

Remaining before approval:

  • Ambiguous-rename advice: the error message and the troubleshooting page should suggest giving each new agent its own server, as the benchmark configs do. Pointing the field at one agent leaves the others without a server. See the inline comments.
  • Ambiguity count: entries that inherit the agent but are no longer agents should not count as rename targets. See the inline comment.
  • PR description: the repository's PR guidelines ask for a linked issue or a reason there is none, rollout evidence or an explicit N/A, and compatibility notes. Please add a compatibility section covering:
    • scripts/add_legacy_agent_environment_servers.py no longer writes blocks for renames, and exits with 2 only for unreadable files.
    • A new AmbiguousAgentRenameError is raised when one agent is inherited into several names and a server still references the old name.
    • Configs migrated by the previous script still load with the same servers.

The broader rename work, which makes renames update routing settings, rows, and dataset pins the same way agent swaps do, is tracked in #4158. That issue also covers sharing one helper for the rule that decides which environment server fields reference an agent, which is now written out in both environment_server_agent_refs and _raise_on_ambiguous_environment_agent_renames.

@zyzhou5

zyzhou5 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5ddf8a2

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 7, 2026 16:52
@copy-pr-bot
copy-pr-bot Bot requested a deployment to public October 7, 2026 17:00 Abandoned
@ananthsub

Copy link
Copy Markdown
Contributor

/ok to test 5ddf8a2

@zyzhou5
zyzhou5 force-pushed the fix-environment-server-agent-renames branch from 5ddf8a2 to aecdabb Compare October 7, 2026 21:45
@zyzhou5

zyzhou5 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test aecdabb

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

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

Merged via the queue into NVIDIA-NeMo:main with commit 073fc32 Oct 7, 2026
43 checks passed
ananthsub pushed a commit to zyzhou5/Gym that referenced this pull request Oct 7, 2026
Backport NVIDIA-NeMo#4141. Resolve the migration-test conflict while preserving the
release branch's Hermes behavior.

(cherry picked from commit 073fc32)
Signed-off-by: Zeyu Zhou <[email protected]>
ananthsub pushed a commit that referenced this pull request Oct 7, 2026
## What does this PR do?

Backport #4141 to `r0.7.0`: preserve Environment Server references when
agents are renamed, with matching migration tooling, diagnostics, and
documentation. No separate issue is needed for this release backport.

Resolved the migration-test conflict while preserving the release
branch's Hermes behavior.

## Validation

- `pytest
tests/unit_tests/{test_global_config,test_add_legacy_agent_environment_servers}.py
-q`: **214 passed**.
- `pytest
tests/unit_tests/{test_task_materialization,test_benchmarks,test_rollout_collection}.py
-q`: **471 passed**.
- `pre-commit run --all-files`, `git diff --check`, and `cd fern && npm
run check`: passed.

## Rollouts

N/A: configuration resolution and migration tooling only; agent, model,
and verifier execution code is unchanged.

## Compatibility and benchmark impact

Matches #4141: the migration script leaves supported renames to Gym and
exits with 2 only for unreadable files. Ambiguous agent renames report
which references need explicit destinations. Previously migrated configs
retain their existing Environment Servers.

Signed-off-by: Zeyu Zhou <[email protected]>
yaoyu-33 added a commit to yaoyu-33/Gym that referenced this pull request Oct 8, 2026
Merge main and preserve the environment server identity introduced by NVIDIA-NeMo#4141. Verify the native-capable rename overlay stays unchanged, the source gets one server, and the renamed agent retains its resources binding.

Signed-off-by: yaoyu-33 <[email protected]>
yaoyu-33 added a commit to yaoyu-33/Gym that referenced this pull request Oct 8, 2026
Merge main and retain the environment server identity introduced by NVIDIA-NeMo#4141. Verify native-capable rename overlays stay unchanged, the source gets exactly one server, and renamed agents retain their resources bindings.

Signed-off-by: yaoyu-33 <[email protected]>
yaoyu-33 added a commit to yaoyu-33/Gym that referenced this pull request Oct 8, 2026
### Launcher shutdown race — October 8

Head `32b7b230bb2a78300c2d0cd65a6db089211065cd` fixes the recurring
[core CI shutdown
failure](https://github.com/NVIDIA-NeMo/Gym/actions/runs/37806810516/job/113413690379).
A TERM signal can arrive after a TP1 engine starts but before its PID is
appended to `worker_pids`; cleanup then misses that process. Cleanup now
uses the serving shell's job table, which already contains the child,
and preserves the shutdown exit status. This also covers the
router/Mooncake children owned by that shell. Model arguments, inference
behavior and agent/verifier code are unchanged.

Validation: a deterministic reproduction of that exact
launch/registration window failed before the fix with the same missing
fourth-engine stop seen in CI, and passes after it. Added TERM and INT
regressions requiring all four engines plus the router to stop; the
five-second timeout and existing assertions remain unchanged.
Source-bound launcher suite: **35 passed, 6 skipped, 199 subtests
passed** on macOS/Bash 3.2. The six existing skips require Bash 5.1+;
Linux CI remains required. Full `pre-commit run --all-files` and `git
diff --check` passed; commit is DCO-signed. Fresh real-model rollout:
N/A for this launcher process-bookkeeping fix, validated with actual
isolated child processes and signals; prior agent/model rollout evidence
remains pinned to its revisions.

[Full CI on head `32b7b230bb2a78300c2d0cd65a6db089211065cd`
passed](https://github.com/NVIDIA-NeMo/Gym/actions/runs/37809392943),
including Linux core/sandbox tests, all eight server shards and
aggregate gates. All 31 current passing checks and 11 legitimate skips
are complete; fresh reviewer approval remains required. This repairs the
CI blocker directly; it does not treat the recurring shutdown failure as
a transient runner issue.

### Merge queue compatibility — October 8

Head `cc532c42d46e289a6b931ba7b0b10c5e7c4470d7` merges current main and
aligns the native-capable migration regression with
[NVIDIA-NeMo#4141](NVIDIA-NeMo#4141): an agent rename
preserves the existing Environment Server's name. The test also verifies
the rename overlay stays untouched, the source receives exactly one
server, and the renamed agent retains its Resources binding.

The [queue
run](https://github.com/NVIDIA-NeMo/Gym/actions/runs/37803971900) failed
in those five parameterized cases. The new commit differs from that
exact queue tree only in the migration test; it applies the same
correction validated for NVIDIA-NeMo#3626.

Validation on this head: **267 passed** using verified source-bound
imports for
`tests/unit_tests/test_add_legacy_agent_environment_servers.py`,
`tests/unit_tests/test_global_config.py`, and
`tests/unit_tests/test_environment_server.py`. Full `pre-commit run
--all-files` and whitespace checks against main and the prior queue tree
passed. Commit has DCO sign-off. Full new-head CI was requested with
`/ok to test cc532c4` and remains
pending.

Fresh model rollout: N/A for this test-only correction relative to the
queue tree; prior model evidence remains pinned to its recorded
revisions.

### Shared contracts — October 6

Head `5a2e582dc`. Aligned the common implementation across NVIDIA-NeMo#3626, NVIDIA-NeMo#3640,
NVIDIA-NeMo#3637 and NVIDIA-NeMo#3639:

- One upstream HTTP-error handler in `SimpleResponsesAPIModel`; preserve
status/body for OpenAI and vLLM, including errors before buffered
Responses streaming starts. No adapter-specific duplicate.
- Identical native-template migration rules and shared regressions.
Explicit-null native templates stay native; bound/inherited Resources
still use compatibility routing.
- Shared sandbox lifecycle helpers still match main. Harness runtimes,
request policies, benchmark settings and scoring are unchanged;
Codex-specific Responses compatibility stays scoped to Codex.

Validation: macOS/Python 3.13.14 selected suites **1,779 passed / 53
skipped**; six final HTTP-error regressions and all-file pre-commit
pass. Skips include Linux and optional runtime tests. No fresh
Linux/model rollout or full-repository CI result is claimed for this
update. [Exact scope, commands and
evidence](https://gitlab-master.nvidia.com/yuya/how-to-run/-/blob/main/issues/2026-10-06-four-harness-common-contracts.md).

---

### Main sync — October 6

Synced with main `045dae678` after NVIDIA-NeMo#3961; head `e4bf3d088`. Shared
`agent_utils` and Hermes files now match main and are absent from this
PR's diff.

- Preserve the Responses bridge and native adapter. Exempt the
explicit-null Codex template from legacy migration, with
inherited-resource and real-template regressions. Remove the redundant
public seed override; invalid multi-worker configuration now follows the
base route's `ValueError` contract (like Hermes), rather than
adapter-specific HTTP 422, and still fails before sandbox setup.
- Final-source macOS/Python 3.13.14 serial suite: **2,054 passed, 64
skipped; 17 subtests passed**. All-file pre-commit passes; Fern check: 0
errors, 1 warning. One unchanged SWE-Pro Xvfb test failed during
parallel validation; all 31 verifier tests and the full selection passed
when run separately. No test was disabled or weakened.
- No fresh Linux or real-model run for this synchronization. Earlier
rollout evidence below applies only to its recorded source pins. Full
mirrored repository CI is separate; no trust-gate approval was posted.

---

Codex runs inside a borrowed task sandbox, or creates one using its
configured provider when no sandbox is supplied. EnvironmentServer
closes the agent before verification.

Implements
[GYMINT-5](https://linear.app/nvidia/issue/GYMINT-5/runbook-onboard-sandboxed-harnesses-to-native-environmentserver).
Targets `main`; shared helpers/tests match NVIDIA-NeMo#3961 at `2093960be`.

## Added / expected

- Use `nemo_gym/agent_utils` and the updated `SandboxSession` contract:
`session_dir`, `stage_activation`, `stop_harness`.
- The session uploads the supervisor, owns control files/deadlines and
exposes diagnostic logs. Adapters keep installation, argv, runtime
metadata and output parsing.
- Preserve retryable cleanup, delayed-launch fencing and partial output
before release. Missing optional diagnostics do not erase valid output;
positive cleanup confirmation remains required.
- Update existing Hermes supervisor imports without taking its separate
config refactor. Merge main at `d04762236`.
- Correct the stale vLLM test to assert the existing upstream HTTP
status/body passthrough. Runtime behavior is unchanged.

## Validation — 5151a3a

- macOS arm64 / Python 3.13.14: **1,605 passed, 62 skipped**, covering
the harness, shared lifecycle/provider/session, both Hermes adapters,
SWE-Pro, EnvironmentServers and model components, plus Responses
bridge/converter/streaming.
- Full `pre-commit run --all-files`, focused shared-module mypy and
whitespace checks pass; all new commits have DCO sign-off.
- Offline wheel build passes; packaged helpers match source
byte-for-byte, with no obsolete helper paths.
- Shared implementation and its three test files match NVIDIA-NeMo#3961
byte-for-byte. Added checks for activation-time upload and shared-log
diagnostics when output is missing.
- **Fresh Linux/model smoke is pending workstation approval.** Earlier
real-model and benchmark results below apply only to their stated
commits.
- [Commands, evidence and
handoff](https://gitlab-master.nvidia.com/yuya/how-to-run/-/blob/main/issues/2026-10-05-pi-codex-shared-session-parents.md).

## Concerns / limits

Full current-head CI and SWE-Pro accuracy have not been rerun. Skips
include Linux-only process tests and optional runtime checks. The
pre-existing minimal-image Bash bootstrap follow-up remains separate.
This update does not change model settings, rewards, benchmark recipes
or TTL defaults. No README command/config change is required; internal
API migration is documented here and in the shared package docstrings.

<details>
<summary>Earlier revision-pinned implementation and validation</summary>

The following previous description is historical, not evidence for this
head.

Codex runs inside a borrowed task sandbox, or creates one using its
configured provider when no sandbox is supplied. EnvironmentServer
closes the agent before verification.

Implements
[GYMINT-5](https://linear.app/nvidia/issue/GYMINT-5/runbook-onboard-sandboxed-harnesses-to-native-environmentserver).
Targets `main`; adopts the shared lifecycle from NVIDIA-NeMo#3961 at `614a08b02`.

## Added / expected

- Reuse NVIDIA-NeMo#3961's `SandboxSession` for execute/close, cleanup confirmation
and owned/borrowed release. Harness adapters retain runtime
installation, commands and output parsing.
- Keep positive cleanup proof mandatory. Malformed optional runtime/exit
diagnostics become explicit gaps; valid harness output is preserved, and
an unknown exit code is never fabricated as zero.
- Capture partial output before releasing the sandbox. Merge current
`main` and preserve the model bridge's upstream-error, streaming and
input-immutability contracts.

- Keep the Codex Responses-to-Chat-Completions bridge. Fix legacy
HarnessAgent requests without an ASGI `scope`.

## Validation — 65186e3

- macOS/Python 3.13.14: **945 passed, 56 skipped**.
- Linux x86_64/Python 3.13.14: **999 passed, 2 skipped**, including
process-supervision, cancellation and cleanup-retry tests.
- Full `pre-commit run --all-files`, focused shared-module mypy and `git
diff --check` pass; commits have DCO sign-off.
- Fresh real-model smoke: **2/2 pass, reward 1 each**, one owned and one
borrowed sandbox. Codex 0.144.4, private Node 22.19.0, Docker and NIM
Nemotron-3-Super-120B-A12B. Checked actual tool execution, file output,
nonzero usage, cleanup receipts and close-before-verify ordering. No
task containers remain.
- Exact source hashes were verified before/after execution. [Commands,
evidence and
handoff](https://gitlab-master.nvidia.com/yuya/how-to-run/-/blob/main/issues/2026-10-05-pi-codex-shared-session-parents.md).

## Concerns / limits

The new smoke uses a small coding task and the stock math verifier; it
is **not a new SWE-Pro accuracy result**. Full-dataset scores below
apply only to their recorded revisions. Two opt-in Linux CLI boundary
tests skip; pinned Codex itself ran in the model smoke. Full repository
CI is separate: currently reported lint, copyright, secret and DCO
checks pass; no current-head full-CI result is claimed.

<details>
<summary>Historical revision-pinned validation and implementation
notes</summary>

The following is the previous description, preserved for evidence.
References to old bases, draft status, strict metadata validation and
pending Linux/model checks describe those older revisions, not the
current head.

Codex runs its CLI and tools inside the benchmark's sandbox using the
shared agent-session contract. Benchmark and harness launch
independently; EnvironmentServer binds them, closes the agent before
verification, and propagates provider/runtime failures without scoring
them as zeros.

Implements the updated [MB-1694
contract](https://linear.app/nvidia/issue/MB-1694/runbook-onboard-sandboxed-harnesses-to-native-environmentserver).
Stacked on NVIDIA-NeMo#3554, integrated through Hermes `95a2b6481`. Remains draft
while broader validation is incomplete.

- Replace Codex-specific session bookkeeping with shared immutable
bindings, cleanup-only setup errors, bounded close receipts, and
identical-activation join/replay. Disconnected waiters do not cancel
execution.
- Reuse the shared Linux supervisor. Fence delayed launches, confirm
descendant cleanup before cancelling provider execution, check receipts
before signaling PIDs, and remove only adapter-owned files.
- Remove `benchmarks/swebench/pro/codex_native.yaml`. Compose
independent `codex_agent.yaml`, SWE-Pro resources, and
`single_agent_turn_legacy`; prepared rows need no additional
materializer. The agent README contains the default command.
- Retain pinned Python 3.8/glibc/musl runtime compatibility from the
preceding revision. Task interpreters and libraries remain unchanged.
- Preserve model HTTP status/body, reasoning/tool history, partial
output, and explicit usage gaps. Model-output/wall-time limits remain
incomplete and potentially gradable; known CLI advisories do not turn
those limits into execution errors. Provider/runtime errors bypass
verification.

Validation at `c1e419ef7bf7940666749a755184200191b8e0e4`:

- Linux/Python 3.13.14: **728 passed**, including the actual Codex
**0.144.4** CLI boundary tests. Suites: Codex, OpenAI Model Server,
SWE-Pro, both single-agent EnvironmentServers, shared session
retries/supervisor, Responses conversion/streaming. Real subprocess
tests cover detached descendants, cancellation, delayed launches, lost
handles, cleanup retries, and Python 3.8 worker execution.
- `python -m pre_commit run --all-files` and `git diff --check` passed;
all new commits have DCO sign-off.
- Additional external vLLM capture suite: **117 passed**. HSG/Python
3.13.14 controller suites: **386 passed, 3 skipped** (opt-in local CLI
and Python 3.8 binaries).
- [HSG real-model
smoke](https://wandb.ai/nvidia-nemo-framework/yuyao-nemo-gym-exps/runs/pr3640-contract-n35ga-20261001-smoke):
**3/3 graded, 2/3 solved**, all three agents completed; zero
setup/agent/verifier errors or masked rows. NodeBB: 290/291 required
tests passed, reward 0; Ansible/Python 3.8: 8/8, reward 1;
Teleport/Alpine: 4/4, reward 1. NodeBB's zero is a real
`canSendValidation` assertion failure at `test/user/emails.js:136`,
confirmed in raw output. Teleport also reports an unrelated
`TestPasswordTimingAttack` failure outside its four benchmark-required
tests; it is retained in the artifacts.
- Smoke controls: Codex 0.144.4, private Node 22.19.0, N35 Super GA,
four GB200 / TP4+EP / no MTP, context 262144, compaction 229376,
concurrency 3, one original attempt per task, **900s agent bound**, and
the stock verifier. No benchmark/parser patches or score-based retries.
A run-local HTTP controller loads independent configs and posts standard
prepared rows to EnvironmentServer.
- Evidence audit passed: **194 captured model calls**, all HTTP 200,
with effective output cap 32768 / temperature 1.0 / top-p 0.95;
aggregate CLI input/output/total usage matches captures for each task.
**219 tool records**. Exact per-call join gaps remain explicit.
- All three agent closes preceded verification. Remote checks found the
runtime process and session files gone, with only the sandbox keep-alive
process remaining; the host runtime installer was never started. Six
successful agent/resources close receipts; post-run inventory found no
owned sandboxes, and the model allocation is released. Normal agent
close took 0.87–2.57s; this is not a concurrency/overhead benchmark.
- Source checks before and after execution verified all **6,125
entries** against the frozen commit with no mismatches. HSG run root:
`/lustre/fs1/portfolios/coreai/projects/coreai_dlalgo_nemogym/users/yuya/pr3640-contract-n35ga-20261001`.
Setup/model/eval/cleanup jobs: 7603886 / 7603926 / 7603927 / 7603928;
independent audit: 7604677.

Limitations: no full-dataset accuracy claim, controlled same-harness
before/after comparison, second real pairing, or measured supervisor
overhead at intended concurrency. Exact model-call join IDs and some CLI
usage details remain unavailable and are marked as observation gaps.
Shared failed-episode responses still omit close observations; the smoke
retains raw close receipts separately. Inference support does not
establish training token-ID/logprob support.


## Shared runner integration (2026-10-02)

Integrated the approved split-contract refactor in
`3fd83ead72d7ddf20c7f2fad2e6eca691678046a` from [draft
#10](#10) / [draft
#11](#11). Cleanup uses the existing
supervisor `CleanupReceipt`; worker identity uses `RunnerRuntimeInfo`;
harness output stays separate. No combined `SandboxRunnerResult`.

Only the Codex callers, shared helper, and relevant tests were
integrated here. Hermes-specific callers and regressions are routed to
NVIDIA-NeMo#3961. The shared helper and its tests are identical across all three
PRs. Remote supervisor/worker files, model requests, sampling and
scoring logic are unchanged; malformed cleanup/runtime metadata is now
rejected. A fenced, unstarted worker retains an unknown exit code, and
runtime failure does not discard confirmed cleanup.

Validation on this integrated head (macOS, Python 3.13.14; pinned Hermes
source and existing dependency environments; localhost fake model/MCP
servers): **459 passed, 50 skipped**. Skips include Linux-only
process-supervision and optional runtime/CLI checks. Full `pre-commit
run --all-files` and `git diff --check` passed; commit is DCO-signed.

```sh
python -m pytest tests/unit_tests/test_sandbox_runner_transport.py \
  tests/unit_tests/test_agent_sessions.py tests/unit_tests/test_agent_session_retries.py \
  tests/unit_tests/test_process_supervisor.py \
  responses_api_agents/codex_agent/tests responses_api_agents/hermes_agent/tests \
  --import-mode=importlib -q -o addopts='' -o log_cli=false
```

CI classification: full (shared core changes). No fresh real-model
rollout or Linux rerun was performed for this integration; prior rollout
evidence above remains pinned to its stated revision and is not evidence
for this new head. Existing PR readiness/labels are unchanged.

</details>

</details>

---------

Signed-off-by: yaoyu-33 <[email protected]>
yaoyu-33 added a commit to yaoyu-33/Gym that referenced this pull request Oct 8, 2026
### Integration with merged Codex support — October 8

Head `3f68583a8a1e4794cf82122576d94294b74b38af` merges main
`acd53a9249b40938b2a3be01c07588ecf0308197` after
[NVIDIA-NeMo#3640](NVIDIA-NeMo#3640) landed. SWE-Pro
permits both `pi_agent` and `codex_agent`, preserving every existing
allowed agent. Both native-default composition regressions remain
intact. The migration assertions also retain
[NVIDIA-NeMo#4141](NVIDIA-NeMo#4141 Environment
Server name-preservation semantics.

Validation on this integrated source: **977 passed, 12 Linux-only
skips** on macOS/Python 3.13.14, with verified source-bound imports. The
selection covers migration, global configuration, EnvironmentServer,
base model capture/HTTP behavior, streaming, and both Pi and Codex
app/native-session tests. Full `pre-commit run --all-files` and the diff
whitespace check against main passed; the merge commit has DCO sign-off.

```text
python -S -m pytest tests/unit_tests/test_add_legacy_agent_environment_servers.py tests/unit_tests/test_global_config.py tests/unit_tests/test_environment_server.py tests/unit_tests/test_base_responses_api_model.py tests/unit_tests/test_responses_api_model_streaming.py responses_api_agents/pi_agent/tests/test_app.py responses_api_agents/pi_agent/tests/test_sandbox.py responses_api_agents/codex_agent/tests/test_app.py responses_api_agents/codex_agent/tests/test_native_sessions.py -q
```

`PYTHONPATH` was set to this isolated worktree and the dependency-only
Python 3.13 site-packages. Pi runtime files are unchanged from
`85d2b4629`; Codex, shared runtime code, and the launcher race fix match
merged main. Fresh model rollout is N/A for the configuration/test
conflict resolution; [prior real-model and native SWE-Pro
evidence](https://gitlab-master.nvidia.com/yuya/how-to-run/-/blob/main/issues/2026-10-07-pi-codex-review-comments.md)
remains pinned to its recorded revisions.

Required CI on `3f68583a8a1e4794cf82122576d94294b74b38af` has passed:
[Nemo_CICD_Test](https://github.com/NVIDIA-NeMo/Gym/actions/runs/37818113383/job/113459296541),
including core/sandbox tests and all eight server shards, plus lint and
DCO. The overall workflow is marked failed because the optional
harness-conformance diagnostics failed; these are non-blocking and have
not been suppressed or changed. Fresh approval and normal merge-queue
validation are still required. Earlier [successful CI on
`85d2b4629`](https://github.com/NVIDIA-NeMo/Gym/actions/runs/37802918495/attempts/2)
remains historical evidence only.

### Review compatibility follow-up — October 7

Head `520b851fa85a9ed4f09335e35f0ced660893a3bf` addresses [the
existing-consumer review
request](NVIDIA-NeMo#3626 (comment)).
Native sandbox sessions retain strict request validation. Calls without
a native session preserve the existing AnySWE, AnyTerminal, and
HarnessAgent contract: forwarded model/sampling/token fields no longer
raise HTTP 422; configured Pi controls remain authoritative. The README
explicitly describes this compatibility behavior. The separate
`pi_sandboxed_agent` introduced by merged NVIDIA-NeMo#3575 remains supported.

Validation on the committed source (macOS arm64, Python 3.13.14):

- Two new regression cases failed before the fix and pass afterward,
covering real ASGI requests and HarnessAgent's scope-less request shape,
response/usage preservation, configuration ownership, and request
immutability. Native unsupported-control rejection remains tested.
- Pi app/session tests: **186 passed, 6 Linux-only skips**.
- Pi, PiSandboxed, AnySWE, AnyTerminal, HarnessAgent, and migration
tests: **405 passed, 28 skipped, 3 local failures**. All three failures
are unchanged AnyTerminal Docker-provider constructor tests because this
host has no Docker binary; full Linux CI remains required.
- Source-bound test command: `python -S -m pytest
responses_api_agents/pi_agent/tests
responses_api_agents/pi_sandboxed_agent/tests
responses_api_agents/anyswe_agent/tests
responses_api_agents/anyterminal_agent/tests
responses_api_agents/harness_agent/tests
tests/unit_tests/test_add_legacy_agent_environment_servers.py
--import-mode=importlib -q -o addopts='' -o log_cli=false --tb=short`
with this checkout and dependency-only site-packages on `PYTHONPATH`.
- `python -S -m pre_commit run --all-files` and `git diff --check`
passed; commit is DCO-signed.
- Fresh real-model compatibility smoke: **2/2 passed, stock math
verifier reward 1 each**, Pi **0.80.2**, NIM
`nvidia/nemotron-3-super-120b-a12b`. Both request shapes forwarded the
previously rejected fields, executed actual Bash/file tools, returned
nonzero usage, preserved caller inputs, and removed their temporary Pi
workspaces. Verified the tested runtime hash matches the committed file.
These are local compatibility-path smokes, not new native sandbox
lifecycle or SWE-Pro accuracy results.

Full current-head [CICD
37659390982](https://github.com/NVIDIA-NeMo/Gym/actions/runs/37659390982)
passed on `520b851fa85a9ed4f09335e35f0ced660893a3bf`, including
core/sandbox tests, all eight server shards, and the aggregate gate.
Wheel validation, lint, copyright, secret scanning, and DCO also pass.
Final review recheck found no new comments or inline threads. CI was
started with `/ok to test` for this exact commit.

---

### Shared contracts — October 6

Head `730765c70`. Aligned the common implementation across NVIDIA-NeMo#3626, NVIDIA-NeMo#3640,
NVIDIA-NeMo#3637 and NVIDIA-NeMo#3639:

- One upstream HTTP-error handler in `SimpleResponsesAPIModel`; preserve
status/body for OpenAI and vLLM, including errors before buffered
Responses streaming starts. No adapter-specific duplicate.
- Identical native-template migration rules and shared regressions.
Explicit-null native templates stay native; bound/inherited Resources
still use compatibility routing.
- Shared sandbox lifecycle helpers still match main. Harness runtimes,
request policies, benchmark settings and scoring are unchanged;
Codex-specific Responses compatibility stays scoped to Codex.

Validation: macOS/Python 3.13.14 selected suites **1,741 passed / 36
skipped**; six final HTTP-error regressions and all-file pre-commit
pass. Skips include Linux and optional runtime tests. No fresh
Linux/model rollout or full-repository CI result is claimed for this
update. [Exact scope, commands and
evidence](https://gitlab-master.nvidia.com/yuya/how-to-run/-/blob/main/issues/2026-10-06-four-harness-common-contracts.md).

---

### Main sync — October 6

Synced with main `045dae678` after NVIDIA-NeMo#3961; head `5c3f3fcf4`. Shared
`agent_utils` and Hermes files now match main and are absent from this
PR's diff.

- Preserve main's failed-attempt ownership capture and this PR's
HTTP-error forwarding. Exempt the explicit-null Pi native template from
legacy migration, with bound/inherited-resource and real-template
composition regressions.
- Final-source macOS/Python 3.13.14: **1,589 passed, 47 skipped; 17
subtests passed**. All-file pre-commit passes; Fern check: 0 errors, 1
warning.
- No fresh Linux or real-model run for this synchronization. Earlier
rollout evidence below applies only to its recorded source pins. Full
mirrored repository CI is separate; no trust-gate approval was posted.

---

Pi runs inside a borrowed task sandbox, or creates one using its
configured provider when no sandbox is supplied. EnvironmentServer
closes the agent before verification.

Implements
[GYMINT-5](https://linear.app/nvidia/issue/GYMINT-5/runbook-onboard-sandboxed-harnesses-to-native-environmentserver).
Targets `main`; shared helpers/tests match NVIDIA-NeMo#3961 at `2093960be`.

## Added / expected

- Use `nemo_gym/agent_utils` and the updated `SandboxSession` contract:
`session_dir`, `stage_activation`, `stop_harness`.
- The session uploads the supervisor, owns control files/deadlines and
exposes diagnostic logs. Adapters keep installation, argv, runtime
metadata and output parsing.
- Preserve retryable cleanup, delayed-launch fencing and partial output
before release. Missing optional diagnostics do not erase valid output;
positive cleanup confirmation remains required.
- Update existing Hermes supervisor imports without taking its separate
config refactor. Merge main at `d04762236`.

## Validation — d91469b

- macOS arm64 / Python 3.13.14: **1,137 passed, 45 skipped**, covering
the harness, shared lifecycle/provider/session, both Hermes adapters,
SWE-Pro, EnvironmentServers and model components.
- Full `pre-commit run --all-files`, focused shared-module mypy and
whitespace checks pass; all new commits have DCO sign-off.
- Offline wheel build passes; packaged helpers match source
byte-for-byte, with no obsolete helper paths.
- Shared implementation and its three test files match NVIDIA-NeMo#3961
byte-for-byte. Added checks for activation-time upload and shared-log
diagnostics when output is missing.
- **Fresh Linux/model smoke is pending workstation approval.** Earlier
real-model and benchmark results below apply only to their stated
commits.
- [Commands, evidence and
handoff](https://gitlab-master.nvidia.com/yuya/how-to-run/-/blob/main/issues/2026-10-05-pi-codex-shared-session-parents.md).

## Concerns / limits

Full current-head CI and SWE-Pro accuracy have not been rerun. Skips
include Linux-only process tests and optional runtime checks. Pi's
existing legacy request-control compatibility work remains separate.
This update does not change model settings, rewards, benchmark recipes
or TTL defaults. No README command/config change is required; internal
API migration is documented here and in the shared package docstrings.

<details>
<summary>Earlier revision-pinned implementation and validation</summary>

The following previous description is historical, not evidence for this
head.

Pi runs inside a borrowed task sandbox, or creates one using its
configured provider when no sandbox is supplied. EnvironmentServer
closes the agent before verification.

Implements
[GYMINT-5](https://linear.app/nvidia/issue/GYMINT-5/runbook-onboard-sandboxed-harnesses-to-native-environmentserver).
Targets `main`; adopts the shared lifecycle from NVIDIA-NeMo#3961 at `614a08b02`.

## Added / expected

- Reuse NVIDIA-NeMo#3961's `SandboxSession` for execute/close, cleanup confirmation
and owned/borrowed release. Harness adapters retain runtime
installation, commands and output parsing.
- Keep positive cleanup proof mandatory. Malformed optional runtime/exit
diagnostics become explicit gaps; valid harness output is preserved, and
an unknown exit code is never fabricated as zero.
- Capture partial output before releasing the sandbox. Merge current
`main` and preserve the model bridge's upstream-error, streaming and
input-immutability contracts.

- Pi's existing request-control policy is unchanged: request-level
`max_output_tokens` is rejected; configured `max_output_tokens` remains
a per-model-call cap. The older AnySWE/HarnessAgent compatibility
request remains separate.

## Validation — 6140623

- macOS/Python 3.13.14: **491 passed, 39 skipped**.
- Linux x86_64/Python 3.13.14: **519 passed, 11 skipped**, including
process-supervision, cancellation and cleanup-retry tests.
- Full `pre-commit run --all-files`, focused shared-module mypy and `git
diff --check` pass; commits have DCO sign-off.
- Fresh real-model smoke: **2/2 pass, reward 1 each**, one owned and one
borrowed sandbox. Pi 0.80.2, private Node 22.19.0, Docker and NIM
Nemotron-3-Super-120B-A12B. Checked actual tool execution, file output,
nonzero usage, cleanup receipts and close-before-verify ordering. No
task containers remain.
- Exact source hashes were verified before/after execution. [Commands,
evidence and
handoff](https://gitlab-master.nvidia.com/yuya/how-to-run/-/blob/main/issues/2026-10-05-pi-codex-shared-session-parents.md).

## Concerns / limits

The new smoke uses a small coding task and the stock math verifier; it
is **not a new SWE-Pro accuracy result**. Full-dataset scores below
apply only to their recorded revisions. Eleven Linux optional
Node/extension tests skip; pinned Pi itself ran in the model smoke. Full
repository CI is separate: currently reported lint, copyright, secret
and DCO checks pass; no current-head full-CI result is claimed.

<details>
<summary>Historical revision-pinned validation and implementation
notes</summary>

The following is the previous description, preserved for evidence.
References to old bases, draft status, strict metadata validation and
pending Linux/model checks describe those older revisions, not the
current head.

Pi runs inside the task sandbox supplied by the benchmark's Resources
Server. The Environment Server owns setup, activation, verification, and
cleanup; Pi borrows the sandbox and runs its own model/tool loop.

Load `responses_api_agents/pi_agent/configs/pi_agent.yaml` for the
standard path. SWE-bench Pro remains independent in
`resources_servers/swebench_pro/configs/swebench_pro.yaml`. The run
binds `pi_agent` and `swebench_pro_resources_server` through the
Environment Server; there is no Pi-specific benchmark recipe or combined
deployment name. The README uses prepared flat rows through
`single_agent_turn_legacy`, without a separate materialization script.
Model selection defaults to `${policy_model_name}`.

Implements [MB-1694](https://linear.app/nvidia/issue/MB-1694);
evaluation is tracked in
[MB-1712](https://linear.app/nvidia/issue/MB-1712). Targets `main` after
NVIDIA-NeMo#3554 merged.

- Reuse shared agent-session seed/close and receipt retention. Identical
activation retries join or replay one invocation; losing an HTTP waiter
does not cancel it. The Environment Server and provider TTL own
cleanup/expiry.
- Reuse shared Linux process supervision. An atomic launch claim fences
delayed starts, and verification requires confirmed descendant cleanup.
Pi never destroys its borrowed sandbox. Include a separate
shared-supervisor fix for a child created before `Popen` loses its
handle (reported on NVIDIA-NeMo#3554).
- Compatibility change: local and sandbox calls now concatenate the
configured system prompt, request instructions, and input system message
in that order. Unsupported non-default request controls, including
developer messages, are rejected instead of silently ignored.
Request-level `max_output_tokens` is rejected because total-response
budgeting is unsupported; the configured Pi `max_output_tokens` remains
a per-model-call cap.
- Preserve upstream HTTP status and error body in the shared OpenAI
Model Server so SDKs can recognize context-limit errors instead of
seeing a generic 500.
- Provider/API and runtime errors propagate without benchmark
verification. Model limits/timeouts preserve gradable partial work.
Context overflow uses pinned Pi's own classifier; observations survive
failed activations.
- Install private Node and pinned Pi outside the repository, supporting
Python 3.8+, glibc x86_64/aarch64, and musl x86_64. Preserve task
runtimes, installer stdout/stderr, npm script restrictions, bash
deadlines, and model HTTP deadlines. The pinned Node build does not
support arm64 musl.

- Confirm supervisor cleanup before cancelling provider execution; check
remote receipts before signaling stored PIDs; reject non-finite or
nonpositive deadlines and access to partially seeded sessions. These
focused follow-ups address the latest NVIDIA-NeMo#3554 review comments.

Validation:

- Final Pi head `ca7d42212`: 642 tests passed across Pi, Hermes
session/runner integration, shared sessions/process supervision,
Environment Server, and Model Server capture/streaming/messages. Tests
include real Linux process-group cancellation, stale-PID protection,
delayed launches, Python 3.8, Node extensions, and Pi 0.80.2 SDK
behavior. Coverage is 96.07% across six affected Python runtime modules.
Full `pre-commit run --all-files` passed; DCO sign-offs present.
- README configuration resolves independent benchmark/agent references
and inherits the model ID. No suffixed Pi configuration or combined
benchmark/agent recipe remains. Reviewed all 44 inline comments and 15
reviews on NVIDIA-NeMo#3554 through its October 1 review, plus issue discussion;
[follow-up
findings](NVIDIA-NeMo#3554 (comment)).
- Completed HSG full evaluation: **358/731 (48.97%), 731 graded, 0
ungraded, 0 agent/verifier errors**. Repaired historical baseline:
**359/731 (49.11%), 730 graded, 1 ungraded**. Difference: one solved
task / −0.137 percentage points; 39 pass→fail, 38 fail→pass. Changed
failures were inspected against raw test logs and show candidate
assertion/build/import failures, not new harness or grading
infrastructure failures. One stochastic run cannot establish identical
outcomes or prove absence of all regression.
- Independently confirmed complete required-test evidence for all 358
reported passes; matched all 731 original task inputs and immutable
image digests. Audited 36,953 model calls, 46,903 tool calls, and 1,462
successful agent/resources close receipts. A real upstream HTTP 400
context limit was preserved, compacted by Pi, and followed by continued
model calls and normal grading. One task hit its 32,768-token output cap
and was normally graded zero.
- Same N35 Super GA checkpoint and serving setup as the repaired
baseline: TP4, four GB200 GPUs, 262,144 context, Pi 0.80.2 with high
thinking, temperature 1 / top-p .95, 32,768 output tokens per call,
concurrency 32. Full evaluation source is frozen at `28df43c18`,
consisting of Pi runtime `0c13326ce` plus the separately disclosed,
hash-pinned historical benchmark parser repairs. Later test-only commit
`8300a1cef` had byte-identical runtime. **The subsequent guard changes
in `ca7d42212` are not included in that full result.**
- The [first 373 original
attempts](https://wandb.ai/nvidia-nemo-framework/yuyao-nemo-gym-exps/runs/pr3626-n35ga-consistency-20261001-v2-full)
and [remaining 358 original
attempts](https://wandb.ai/nvidia-nemo-framework/yuyao-nemo-gym-exps/runs/pr3626-n35ga-consistency-20261001-v2-c1-full)
cover disjoint original IDs with no retries or replacement. The first
controller stopped dispatch during a roughly seven-minute model API
stall, so its W&B run is marked failed although all 373 started episodes
returned normally. The same model allocation recovered without restart
and served the continuation. Both sandbox cleanup inventories are empty,
and the owned model was cancelled.
- Before that full run, HSG setup passed 338 tests (10 optional checks
skipped on the CPU controller and covered locally), a real two-turn
model tool preflight passed, and the [8-task
smoke](https://wandb.ai/nvidia-nemo-framework/yuyao-nemo-gym-exps/runs/pr3626-n35ga-consistency-20261001-v2-smoke)
produced 8 graded / 6 solved, zero agent/verifier errors, 411 model
calls, 522 tool calls, and 16 close receipts.
- Final guard-version HSG validation completed: 360 setup tests passed
(10 optional runtime checks skipped and covered locally), the real
two-turn tool preflight passed, and the [8-task
smoke](https://wandb.ai/nvidia-nemo-framework/yuyao-nemo-gym-exps/runs/pr3626-n35ga-review-guards-20261001-smoke)
returned **8 graded / 5 solved / 0 agent or verifier errors**. Snapshot
`dc1550231` contains Pi `ca7d42212` plus the same benchmark repairs.
Audited all 406 model calls, 522 tool calls, 406 available model
references, and 16 successful close receipts; all five passes have
complete required-test evidence. Zero results: a NodeBB assertion
failure, ProtonMail UI assertion failures, and the previously observed
Flipt `Secure`-field compilation failure. All 6,134 source entries match
after execution; the run is finished, sandbox inventories are empty, and
the owned model was cancelled. This validates the guard changes with
real rollouts; it is separate from the earlier 731-task result.

The upstream target mirror
`NVIDIA-NeMo/Gym:codex/hermes-swe-pro-validation` is synchronized with
NVIDIA-NeMo#3554 at `d5f13f54cf762c7e687dd2d50d2583efe2c9b717`. The mirror advanced
by 11 commits using a fast-forward. Pi head `ca7d42212` is unchanged, so
the recorded validation still applies; the diff against the synchronized
base contains 23 changed files.

The inherited SWE Pro response still reports incomplete verification
separately via `evaluation_completed=false`; changing its default
reward/mask contract is flagged for the shared benchmark rather than
silently changed here. Full-run accuracy and grading coverage are
reported separately.


## Shared runner integration (2026-10-02)

Integrated the approved split-contract refactor in
`5741f9f4fd816f6c4e79ac1002793adb1db6c3af` from [draft
#10](#10) / [draft
#11](#11). Cleanup uses the existing
supervisor `CleanupReceipt`; worker identity uses `RunnerRuntimeInfo`;
harness output stays separate. No combined `SandboxRunnerResult`.

Only the Pi callers, shared helper, and relevant tests were integrated
here. Hermes-specific callers and regressions are routed to NVIDIA-NeMo#3961. The
shared helper and its tests are identical across all three PRs. Remote
supervisor/worker files, model requests, sampling and scoring logic are
unchanged; malformed cleanup/runtime metadata is now rejected. A fenced,
unstarted worker retains an unknown exit code, and runtime failure does
not discard confirmed cleanup.

Validation on this integrated head (macOS, Python 3.13.14; pinned Hermes
source and existing dependency environments; localhost fake model/MCP
servers): **448 passed, 37 skipped**. Skips include Linux-only
process-supervision and optional runtime/CLI checks. Full `pre-commit
run --all-files` and `git diff --check` passed; commit is DCO-signed.

```sh
python -m pytest tests/unit_tests/test_sandbox_runner_transport.py \
  tests/unit_tests/test_agent_sessions.py tests/unit_tests/test_agent_session_retries.py \
  tests/unit_tests/test_process_supervisor.py \
  responses_api_agents/pi_agent/tests responses_api_agents/hermes_agent/tests \
  --import-mode=importlib -q -o addopts='' -o log_cli=false
```

CI classification: full (shared core changes). No fresh real-model
rollout or Linux rerun was performed for this integration; prior rollout
evidence above remains pinned to its stated revision and is not evidence
for this new head. Existing PR readiness/labels are unchanged.


## Rebase to main — October 2

Targets `main`; NVIDIA-NeMo#3554 is merged. Current-head macOS/Python 3.13.14
checks: **337 passed, 26 skipped**, full pre-commit and whitespace
checks passed. Linux-only/optional tests remain skipped; no fresh
real-model run was performed. Earlier rollout evidence remains tied to
its recorded commits.

## HSG Linux test follow-up (2026-10-03)

Published test-only commit `9f28b7278dfc53a292a128587520b92af12e0fdf`.
Isolate the stdlib event-producer subprocess with `-I -S` and include
cleanup/runtime/event logs before decoding failed output. The original
intermittent empty capture remains unexplained; a controlled slow site
hook fails before the patch and passes afterward under the same
deadline.

HSG Linux aarch64/Python 3.13.14: **366 passed / 13 skipped**, plus
**30/30** distinct executions of the affected test. Full local
`pre-commit run --all-files` and whitespace checks pass; commit has DCO
sign-off. The listed GitHub lint, copyright, secret and DCO checks also
pass. Full repository/component CI remains separate.

```bash
python -m pytest responses_api_agents/pi_agent/tests \
  tests/unit_tests/test_base_responses_api_agent.py \
  tests/unit_tests/test_agent_sessions.py tests/unit_tests/test_agent_session_retries.py \
  tests/unit_tests/test_episode_types.py environment_servers/single_agent_turn/tests \
  tests/unit_tests/test_sandbox_runner_transport.py tests/unit_tests/test_process_supervisor.py responses_api_agents/pi_sandboxed_agent/tests responses_api_models/openai_model/tests \
  --import-mode=importlib -q -o addopts='' -o log_cli=false --tb=short
```

Executed with source-bound imports and compatible dependency-only
site-packages; [shared-board evidence, exact drivers, pins, jobs, skips
and
limitations](https://gitlab-master.nvidia.com/yuya/how-to-run/-/blob/main/fixes/harness-linux-test-stability.md).
All four selected HSG suites pass 1,860 tests with 20 skips. Prior
owned/borrowed real-model smokes remain pinned to their original
revisions; these later test-only edits do not change production behavior
and no model rerun is claimed.

</details>

</details>

---------

Signed-off-by: yaoyu-33 <[email protected]>

This branch was previously deployed

1 inactive deployment
public — aecdabb9 Deployed Oct 7, 2026 by copy-pr-bot[bot] via release / finalize / notify #4605
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Hydra configuration, schemas, composition, and compatibility bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer r0.7.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants