Skip to content

(fix) Move mlflow/wandb out of core deps and into extras - #3547

Merged
hwolff99 merged 9 commits into
mainfrom
hwolff/optional-exporter-deps
Oct 4, 2026
Merged

hwolff99 merged 9 commits into
mainfrom
hwolff/optional-exporter-deps

Conversation

@hwolff99

@hwolff99 hwolff99 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Moves optional exporter deps into pyproject.toml extras so they are not automatically installed.
Closes #3207

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Signed-off-by: haydeniw <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

hwolff99 and others added 2 commits September 18, 2026 15:42
…ency change

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Signed-off-by: haydeniw <[email protected]>
gitlab_utils.py's GitLab model-registry integration imported mlflow eagerly at module
top-level, breaking any import of nemo_gym.cli.dataset / nemo_gym.dataset_orchestrator
without mlflow installed. create_mlflow_client() now imports mlflow lazily and raises an
actionable ConfigError (pip install nemo-gym[mlflow]) instead of an opaque ImportError.

reward_profile.py was the bigger find: `from wandb import Histogram` at module top-level
made wandb a de-facto core dependency of nearly all of Gym (via base_resources_server.py /
base_responses_api_agent.py), even though the histogram stat is always stripped before it
reaches any output or exporter. Made that import lazy too, falling back to None when wandb
isn't installed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Signed-off-by: haydeniw <[email protected]>
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

The generic except Exception fallback already surfaces a missing SDK's ImportError
message without crashing setup_exporters, so this extra ImportError-specific branch
wasn't necessary. Reverts the registry 3-tuple and its test in test_exporters.py too.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Signed-off-by: haydeniw <[email protected]>
@hwolff99
hwolff99 marked this pull request as ready for review September 21, 2026 05:24
@hwolff99
hwolff99 requested a review from a team as a code owner September 21, 2026 05:24
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team September 21, 2026 05:24
Comment thread nemo_gym/reward_profile.py Resolved
Comment thread nemo_gym/gitlab_utils.py Resolved
Comment thread tests/unit_tests/test_exporters.py Resolved
@yaoyu-33 yaoyu-33 added area:build Packaging, dependencies, containers, and releases bug Something isn't working complexity:medium Single-domain change with interacting parts or a moderate review surface waiting-on-customer Waiting on the original author to respond labels Sep 21, 2026
@github-actions github-actions Bot added the sla:author-overdue Author response is over the one-business-day SLA label Sep 22, 2026
setup_exporters now catches ImportError specifically and names the extra to install
(pip install nemo-gym[mlflow] / [wandb]) instead of relying on the generic except
Exception fallback's raw exception text.

This restores the change dropped in 580e893. That revert was a mistake: I judged the
change unnecessary since setup_exporters already failed gracefully, but PR review
(#3547) asked for exactly this behavior, plus extending it to rollout
collection.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Signed-off-by: haydeniw <[email protected]>
@hwolff99
hwolff99 added this pull request to the merge queue Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

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

Merged via the queue into main with commit 128eab4 Oct 4, 2026
43 checks passed
@hwolff99
hwolff99 deleted the hwolff/optional-exporter-deps branch October 4, 2026 18:41
khazic pushed a commit to khazic/Gym-lao that referenced this pull request Oct 5, 2026
…the migration script (NVIDIA-NeMo#3929)

## What does this PR do?

Since NVIDIA-NeMo#3724, config validation rejects any agent that no environment
server names, with `AgentWithoutEnvironmentServerError`. A config
written before environment servers therefore stops loading when Gym is
upgraded. This also affects configs in this repository:
`resources_servers/wordle/configs/wordle.yaml` and
`environments/wordle/config.yaml` fail to parse on `main`.

This PR turns that error into a deprecation, so these configs keep
running while users migrate. It also fixes the migration script so it
can update configs outside this repository.

### What happens to an agent without an environment server

During config parsing, Gym finds each agent that no environment server
names. For each one, it adds a `legacy_agent` environment server in
front of the agent. A `legacy_agent` server relays `/run` to its agent
unchanged, so rollouts and results are the same as before. Gym then logs
one deprecation warning:

```
DEPRECATED: agents without an environment server: `workplace_assistant_simple_agent`.
Rollout collection reaches an agent only through an environment server.
This run generated a legacy_agent environment server for each agent above.
Each one relays /run to its agent unchanged, so results are not affected.
A future release will reject these configs with AgentWithoutEnvironmentServerError.

To migrate, declare the environment servers in your config. Either:

1. Run the migration script from a NeMo Gym checkout on your config files or directories:

     python scripts/add_legacy_agent_environment_servers.py path/to/config.yaml [more paths] [--check]

   --check reports what would change without writing.

2. Or add these blocks yourself, at the same level as the agents:

     workplace_assistant_environment_server:
       environment_servers:
         legacy_agent:
           entrypoint: app.py
           agent_server:
             type: responses_api_agents
             name: workplace_assistant_simple_agent

To make this an error now, set error_on_agent_without_environment_server: true in your config.
You can also pass +error_on_agent_without_environment_server=true on the command line.
```

- The generated server is named the way the migration script names it:
the agent type is stripped from the agent name. For example,
`workplace_assistant_simple_agent` gets
`workplace_assistant_environment_server`. The block in the warning is
therefore the block the script writes. If that name is already taken,
the server is named `<agent>_environment_server` instead.
- Gym only adds a server for an agent that has none. An agent with an
existing environment server is left alone, so the new server can never
make agent routing ambiguous.
- Setting `error_on_agent_without_environment_server: true` restores the
error. It follows the existing `error_on_almost_servers` switch. The
error message now also points at the migration script.
- Renaming an agent with `_inherit_from` moves it to the new name. An
environment server that named the old agent is then left pointing at an
agent that no longer exists, and parsing fails with
`ServerRefNotFoundError`. That error now says the environment server
must be renamed with the agent, and points at the script.

The test this PR replaces explained why the error existed: without it, a
config written before environment servers "would otherwise run, silently
dispatching straight to the agent." The generated server keeps that
guarantee. Rollout collection still reaches the agent only through an
environment server, and the warning names every server Gym added.

### Fixes to `scripts/add_legacy_agent_environment_servers.py`

- The script now accepts config files and directories as arguments.
Before, it could only update this repository's configs, so users had no
way to migrate their own. Run without arguments, it still updates this
repository's configs.
- The script now skips an agent that any environment server already
names. Before, it only checked whether a server with the generated name
existed. In `benchmarks/swebench/pro/hermes.yaml`, a
`single_agent_turn_legacy` server already fronts the agent under a
different name, so the script added a second server. Two servers in
front of one agent make agent routing ambiguous, and rollout collection
then fails.
- The script now handles an agent that only renames another one, such as
`renamed_agent: {_inherit_from: some_agent}`. Before, such configs were
skipped because the new instance has no agent body of its own. The
script now writes a server for the new name that inherits the original
agent's server. Because `_inherit_from` moves the original server, the
renamed agent ends up with exactly one server.
- A config that cannot be read or parsed is now reported, and the script
exits with 2. Before, such files were skipped without any message.

`test_langchain_deepagents_configs_have_environment_servers` now parses
with `error_on_agent_without_environment_server: true`. The test checks
that in-repo configs declare their environment server. A generated
server would have the same name, so without strict mode the test would
pass even when the declaration is missing.

The script's `--check` mode reports six configs on `main` that declare
no environment server: two `wordle` configs, two `swemer_oml` configs,
and two `swe_internal_v1` configs. With this PR they load with the
deprecation warning. Migrating them is left to their owners.

No issue is linked. This is a compatibility follow-up to NVIDIA-NeMo#3724.

## Validation

- `pytest tests/unit_tests/test_global_config.py`, covering the
generated server, its name, the warning text, strict mode, an agent that
already has a server, a name collision, a full `parse()` of a config
without environment servers, and the rename hint on
`ServerRefNotFoundError`.
- `pytest tests/unit_tests/test_add_legacy_agent_environment_servers.py`
(new), covering configs outside the repository, `--check` not writing,
an agent that already has a server, a rename through `_inherit_from`, an
unreadable config, and that the script and Gym name servers the same
way. The behavior tests fail against the script on `main`.
- Six configs outside this repository that failed validation were
migrated with the script, covering both added agents and `_inherit_from`
renames. Each migrated config was then parsed with
`GlobalConfigDictParser` and `error_on_agent_without_environment_server:
true`. An unmigrated copy, parsed the same way, raised
`AgentWithoutEnvironmentServerError`.
- `pytest tests/unit_tests/test_rollout_collection.py
tests/unit_tests/test_environment_scaffold.py`.
- `pytest tests/unit_tests`. The tests that fail in this environment
fail identically on `main`. They need the `sandbox` extra, or `mlflow`
and `wandb`, which NVIDIA-NeMo#3547 moved into extras.
- `pre-commit run --all-files`.

## Rollouts

`example_single_tool_call` was run with its environment server block
removed from the config, against `Qwen/Qwen3-0.6B` served by a local
vLLM with the hermes tool parser:

- `gym env start` logged the deprecation warning and started the
generated environment server alongside the agent, the resources server,
and the model server.
- `gym eval run --no-serve` completed every requested rollout without
failures. Each record has the generated server in
`_ng_environment_server` and `legacy_agent` in `_ng_result_type`.
- When the model called `get_weather`, the verifier scored the rollout
1.0. When it answered in prose without calling the tool, the verifier
scored it 0.0.

Dispatch through the generated server has not changed since that run.
Only the server's name and the warning text have.

## Compatibility and benchmark impact

- Configs that failed with `AgentWithoutEnvironmentServerError` now load
and log a deprecation warning. Results do not change, because
`legacy_agent` relays `/run` to the agent unchanged.
- Users who want the error back can set
`error_on_agent_without_environment_server: true`. The warning tells
users that a future release will make this the default.
- No benchmark impact.

Proposed labels: `feature`, `area:config`.

## Checklist

- [x] I have read the [contributing
guidelines](https://github.com/NVIDIA-NeMo/Gym/blob/main/CONTRIBUTING.md).
- [x] The change is focused; unrelated "drive-by" edits are tracked as
separate issues/PRs.
- [x] Tests added or updated and pass locally, or N/A for docs-only /
non-code changes (so CI unit/server checks pass when applicable).
- [x] Documentation added or updated, or N/A with justification.
- [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so
CI lint/format checks pass).
- [x] New source files include the required Apache-2.0 SPDX header.
- [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check
passes).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Ananth Subramaniam <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
ananthsub added a commit to ananthsub/Gym that referenced this pull request Oct 5, 2026
…the migration script (NVIDIA-NeMo#3929)

Since NVIDIA-NeMo#3724, config validation rejects any agent that no environment
server names, with `AgentWithoutEnvironmentServerError`. A config
written before environment servers therefore stops loading when Gym is
upgraded. This also affects configs in this repository:
`resources_servers/wordle/configs/wordle.yaml` and
`environments/wordle/config.yaml` fail to parse on `main`.

This PR turns that error into a deprecation, so these configs keep
running while users migrate. It also fixes the migration script so it
can update configs outside this repository.

During config parsing, Gym finds each agent that no environment server
names. For each one, it adds a `legacy_agent` environment server in
front of the agent. A `legacy_agent` server relays `/run` to its agent
unchanged, so rollouts and results are the same as before. Gym then logs
one deprecation warning:

```
DEPRECATED: agents without an environment server: `workplace_assistant_simple_agent`.
Rollout collection reaches an agent only through an environment server.
This run generated a legacy_agent environment server for each agent above.
Each one relays /run to its agent unchanged, so results are not affected.
A future release will reject these configs with AgentWithoutEnvironmentServerError.

To migrate, declare the environment servers in your config. Either:

1. Run the migration script from a NeMo Gym checkout on your config files or directories:

     python scripts/add_legacy_agent_environment_servers.py path/to/config.yaml [more paths] [--check]

   --check reports what would change without writing.

2. Or add these blocks yourself, at the same level as the agents:

     workplace_assistant_environment_server:
       environment_servers:
         legacy_agent:
           entrypoint: app.py
           agent_server:
             type: responses_api_agents
             name: workplace_assistant_simple_agent

To make this an error now, set error_on_agent_without_environment_server: true in your config.
You can also pass +error_on_agent_without_environment_server=true on the command line.
```

- The generated server is named the way the migration script names it:
the agent type is stripped from the agent name. For example,
`workplace_assistant_simple_agent` gets
`workplace_assistant_environment_server`. The block in the warning is
therefore the block the script writes. If that name is already taken,
the server is named `<agent>_environment_server` instead.
- Gym only adds a server for an agent that has none. An agent with an
existing environment server is left alone, so the new server can never
make agent routing ambiguous.
- Setting `error_on_agent_without_environment_server: true` restores the
error. It follows the existing `error_on_almost_servers` switch. The
error message now also points at the migration script.
- Renaming an agent with `_inherit_from` moves it to the new name. An
environment server that named the old agent is then left pointing at an
agent that no longer exists, and parsing fails with
`ServerRefNotFoundError`. That error now says the environment server
must be renamed with the agent, and points at the script.

The test this PR replaces explained why the error existed: without it, a
config written before environment servers "would otherwise run, silently
dispatching straight to the agent." The generated server keeps that
guarantee. Rollout collection still reaches the agent only through an
environment server, and the warning names every server Gym added.

- The script now accepts config files and directories as arguments.
Before, it could only update this repository's configs, so users had no
way to migrate their own. Run without arguments, it still updates this
repository's configs.
- The script now skips an agent that any environment server already
names. Before, it only checked whether a server with the generated name
existed. In `benchmarks/swebench/pro/hermes.yaml`, a
`single_agent_turn_legacy` server already fronts the agent under a
different name, so the script added a second server. Two servers in
front of one agent make agent routing ambiguous, and rollout collection
then fails.
- The script now handles an agent that only renames another one, such as
`renamed_agent: {_inherit_from: some_agent}`. Before, such configs were
skipped because the new instance has no agent body of its own. The
script now writes a server for the new name that inherits the original
agent's server. Because `_inherit_from` moves the original server, the
renamed agent ends up with exactly one server.
- A config that cannot be read or parsed is now reported, and the script
exits with 2. Before, such files were skipped without any message.

`test_langchain_deepagents_configs_have_environment_servers` now parses
with `error_on_agent_without_environment_server: true`. The test checks
that in-repo configs declare their environment server. A generated
server would have the same name, so without strict mode the test would
pass even when the declaration is missing.

The script's `--check` mode reports six configs on `main` that declare
no environment server: two `wordle` configs, two `swemer_oml` configs,
and two `swe_internal_v1` configs. With this PR they load with the
deprecation warning. Migrating them is left to their owners.

No issue is linked. This is a compatibility follow-up to NVIDIA-NeMo#3724.

- `pytest tests/unit_tests/test_global_config.py`, covering the
generated server, its name, the warning text, strict mode, an agent that
already has a server, a name collision, a full `parse()` of a config
without environment servers, and the rename hint on
`ServerRefNotFoundError`.
- `pytest tests/unit_tests/test_add_legacy_agent_environment_servers.py`
(new), covering configs outside the repository, `--check` not writing,
an agent that already has a server, a rename through `_inherit_from`, an
unreadable config, and that the script and Gym name servers the same
way. The behavior tests fail against the script on `main`.
- Six configs outside this repository that failed validation were
migrated with the script, covering both added agents and `_inherit_from`
renames. Each migrated config was then parsed with
`GlobalConfigDictParser` and `error_on_agent_without_environment_server:
true`. An unmigrated copy, parsed the same way, raised
`AgentWithoutEnvironmentServerError`.
- `pytest tests/unit_tests/test_rollout_collection.py
tests/unit_tests/test_environment_scaffold.py`.
- `pytest tests/unit_tests`. The tests that fail in this environment
fail identically on `main`. They need the `sandbox` extra, or `mlflow`
and `wandb`, which NVIDIA-NeMo#3547 moved into extras.
- `pre-commit run --all-files`.

`example_single_tool_call` was run with its environment server block
removed from the config, against `Qwen/Qwen3-0.6B` served by a local
vLLM with the hermes tool parser:

- `gym env start` logged the deprecation warning and started the
generated environment server alongside the agent, the resources server,
and the model server.
- `gym eval run --no-serve` completed every requested rollout without
failures. Each record has the generated server in
`_ng_environment_server` and `legacy_agent` in `_ng_result_type`.
- When the model called `get_weather`, the verifier scored the rollout
1.0. When it answered in prose without calling the tool, the verifier
scored it 0.0.

Dispatch through the generated server has not changed since that run.
Only the server's name and the warning text have.

- Configs that failed with `AgentWithoutEnvironmentServerError` now load
and log a deprecation warning. Results do not change, because
`legacy_agent` relays `/run` to the agent unchanged.
- Users who want the error back can set
`error_on_agent_without_environment_server: true`. The warning tells
users that a future release will make this the default.
- No benchmark impact.

Proposed labels: `feature`, `area:config`.

- [x] I have read the [contributing
guidelines](https://github.com/NVIDIA-NeMo/Gym/blob/main/CONTRIBUTING.md).
- [x] The change is focused; unrelated "drive-by" edits are tracked as
separate issues/PRs.
- [x] Tests added or updated and pass locally, or N/A for docs-only /
non-code changes (so CI unit/server checks pass when applicable).
- [x] Documentation added or updated, or N/A with justification.
- [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so
CI lint/format checks pass).
- [x] New source files include the required Apache-2.0 SPDX header.
- [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check
passes).


---------

Signed-off-by: Ananth Subramaniam <[email protected]>
(cherry picked from commit 1f2446c)
Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit to ananthsub/Gym that referenced this pull request Oct 6, 2026
…the migration script (NVIDIA-NeMo#3929)

Since NVIDIA-NeMo#3724, config validation rejects any agent that no environment
server names, with `AgentWithoutEnvironmentServerError`. A config
written before environment servers therefore stops loading when Gym is
upgraded. This also affects configs in this repository:
`resources_servers/wordle/configs/wordle.yaml` and
`environments/wordle/config.yaml` fail to parse on `main`.

This PR turns that error into a deprecation, so these configs keep
running while users migrate. It also fixes the migration script so it
can update configs outside this repository.

During config parsing, Gym finds each agent that no environment server
names. For each one, it adds a `legacy_agent` environment server in
front of the agent. A `legacy_agent` server relays `/run` to its agent
unchanged, so rollouts and results are the same as before. Gym then logs
one deprecation warning:

```
DEPRECATED: agents without an environment server: `workplace_assistant_simple_agent`.
Rollout collection reaches an agent only through an environment server.
This run generated a legacy_agent environment server for each agent above.
Each one relays /run to its agent unchanged, so results are not affected.
A future release will reject these configs with AgentWithoutEnvironmentServerError.

To migrate, declare the environment servers in your config. Either:

1. Run the migration script from a NeMo Gym checkout on your config files or directories:

     python scripts/add_legacy_agent_environment_servers.py path/to/config.yaml [more paths] [--check]

   --check reports what would change without writing.

2. Or add these blocks yourself, at the same level as the agents:

     workplace_assistant_environment_server:
       environment_servers:
         legacy_agent:
           entrypoint: app.py
           agent_server:
             type: responses_api_agents
             name: workplace_assistant_simple_agent

To make this an error now, set error_on_agent_without_environment_server: true in your config.
You can also pass +error_on_agent_without_environment_server=true on the command line.
```

- The generated server is named the way the migration script names it:
the agent type is stripped from the agent name. For example,
`workplace_assistant_simple_agent` gets
`workplace_assistant_environment_server`. The block in the warning is
therefore the block the script writes. If that name is already taken,
the server is named `<agent>_environment_server` instead.
- Gym only adds a server for an agent that has none. An agent with an
existing environment server is left alone, so the new server can never
make agent routing ambiguous.
- Setting `error_on_agent_without_environment_server: true` restores the
error. It follows the existing `error_on_almost_servers` switch. The
error message now also points at the migration script.
- Renaming an agent with `_inherit_from` moves it to the new name. An
environment server that named the old agent is then left pointing at an
agent that no longer exists, and parsing fails with
`ServerRefNotFoundError`. That error now says the environment server
must be renamed with the agent, and points at the script.

The test this PR replaces explained why the error existed: without it, a
config written before environment servers "would otherwise run, silently
dispatching straight to the agent." The generated server keeps that
guarantee. Rollout collection still reaches the agent only through an
environment server, and the warning names every server Gym added.

- The script now accepts config files and directories as arguments.
Before, it could only update this repository's configs, so users had no
way to migrate their own. Run without arguments, it still updates this
repository's configs.
- The script now skips an agent that any environment server already
names. Before, it only checked whether a server with the generated name
existed. In `benchmarks/swebench/pro/hermes.yaml`, a
`single_agent_turn_legacy` server already fronts the agent under a
different name, so the script added a second server. Two servers in
front of one agent make agent routing ambiguous, and rollout collection
then fails.
- The script now handles an agent that only renames another one, such as
`renamed_agent: {_inherit_from: some_agent}`. Before, such configs were
skipped because the new instance has no agent body of its own. The
script now writes a server for the new name that inherits the original
agent's server. Because `_inherit_from` moves the original server, the
renamed agent ends up with exactly one server.
- A config that cannot be read or parsed is now reported, and the script
exits with 2. Before, such files were skipped without any message.

`test_langchain_deepagents_configs_have_environment_servers` now parses
with `error_on_agent_without_environment_server: true`. The test checks
that in-repo configs declare their environment server. A generated
server would have the same name, so without strict mode the test would
pass even when the declaration is missing.

The script's `--check` mode reports six configs on `main` that declare
no environment server: two `wordle` configs, two `swemer_oml` configs,
and two `swe_internal_v1` configs. With this PR they load with the
deprecation warning. Migrating them is left to their owners.

No issue is linked. This is a compatibility follow-up to NVIDIA-NeMo#3724.

- `pytest tests/unit_tests/test_global_config.py`, covering the
generated server, its name, the warning text, strict mode, an agent that
already has a server, a name collision, a full `parse()` of a config
without environment servers, and the rename hint on
`ServerRefNotFoundError`.
- `pytest tests/unit_tests/test_add_legacy_agent_environment_servers.py`
(new), covering configs outside the repository, `--check` not writing,
an agent that already has a server, a rename through `_inherit_from`, an
unreadable config, and that the script and Gym name servers the same
way. The behavior tests fail against the script on `main`.
- Six configs outside this repository that failed validation were
migrated with the script, covering both added agents and `_inherit_from`
renames. Each migrated config was then parsed with
`GlobalConfigDictParser` and `error_on_agent_without_environment_server:
true`. An unmigrated copy, parsed the same way, raised
`AgentWithoutEnvironmentServerError`.
- `pytest tests/unit_tests/test_rollout_collection.py
tests/unit_tests/test_environment_scaffold.py`.
- `pytest tests/unit_tests`. The tests that fail in this environment
fail identically on `main`. They need the `sandbox` extra, or `mlflow`
and `wandb`, which NVIDIA-NeMo#3547 moved into extras.
- `pre-commit run --all-files`.

`example_single_tool_call` was run with its environment server block
removed from the config, against `Qwen/Qwen3-0.6B` served by a local
vLLM with the hermes tool parser:

- `gym env start` logged the deprecation warning and started the
generated environment server alongside the agent, the resources server,
and the model server.
- `gym eval run --no-serve` completed every requested rollout without
failures. Each record has the generated server in
`_ng_environment_server` and `legacy_agent` in `_ng_result_type`.
- When the model called `get_weather`, the verifier scored the rollout
1.0. When it answered in prose without calling the tool, the verifier
scored it 0.0.

Dispatch through the generated server has not changed since that run.
Only the server's name and the warning text have.

- Configs that failed with `AgentWithoutEnvironmentServerError` now load
and log a deprecation warning. Results do not change, because
`legacy_agent` relays `/run` to the agent unchanged.
- Users who want the error back can set
`error_on_agent_without_environment_server: true`. The warning tells
users that a future release will make this the default.
- No benchmark impact.

Proposed labels: `feature`, `area:config`.

- [x] I have read the [contributing
guidelines](https://github.com/NVIDIA-NeMo/Gym/blob/main/CONTRIBUTING.md).
- [x] The change is focused; unrelated "drive-by" edits are tracked as
separate issues/PRs.
- [x] Tests added or updated and pass locally, or N/A for docs-only /
non-code changes (so CI unit/server checks pass when applicable).
- [x] Documentation added or updated, or N/A with justification.
- [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so
CI lint/format checks pass).
- [x] New source files include the required Apache-2.0 SPDX header.
- [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check
passes).

---------

Signed-off-by: Ananth Subramaniam <[email protected]>
(cherry picked from commit 1f2446c)
Signed-off-by: Ananth Subramaniam <[email protected]>
khazic pushed a commit to khazic/Gym-lao that referenced this pull request Oct 15, 2026
…EADME (NVIDIA-NeMo#4574)

## What does this PR do?

The math_with_judge README's "Prepare for trajectory collection" command
works again. It loads `configs/dapo17k_trajectory_collection.yaml`,
which no longer exists, so `gym dataset collate` exited with
`ConfigPathNotFoundError` before downloading anything. This PR restores
that config in the current schema, documents the step's prerequisites,
and adds a regression test that replays the README command.

Running the README's other GitLab download, OpenMathReasoning, from
outside the Gym root exposed a second bug: the GitLab downloader did not
create the output directory. The second commit fixes it.

Fixes NVBug [6847517](https://nvbugspro.nvidia.com/bug/6847517).
Closes NVIDIA-NeMo#4498.

### Cause

NVIDIA-NeMo#859 ("Gym 0.2.0 huggingface dataset pointers") deleted three dapo17k
variants under `resources_servers/math_with_judge/configs/`, including
`dapo17k_trajectory_collection.yaml`, and removed their root-README
rows. The math_with_judge README, which has cited that file since NVIDIA-NeMo#291,
was not updated. Config resolution (`nemo_gym/global_config.py`
`load_extra_config_paths`) then raises `ConfigPathNotFoundError`.

`dapo17k.yaml` is not a drop-in replacement. The deleted config put the
DAPO17k train problems in the **validation** split, repeated 16 times,
because NeMo RL with `is_trajectory_collection: true` collects from the
validation dataloader only. `dapo17k.yaml` has DAPO17k as `train` ×1 and
AIME24 ×32 as `validation`, so trajectory collection would run on
AIME24.

Restoring the old file verbatim would not work either. It set
`judge_model_server.name: ???`, and since NVIDIA-NeMo#1575 the parser rejects any
`???` left after merging (`ConfigMissingValuesError`).

The second bug is in `download_jsonl_dataset`
(`nemo_gym/gitlab_utils.py`). It opened `output_fpath` for writing
without creating its directory. A Gym checkout tracks `data/`, so the
README's `--output data/open_math_reasoning_problems.jsonl` works from
the Gym root but fails with `FileNotFoundError` from any other
directory. `gym dataset collate --download` fails the same way for
GitLab-backed datasets. The Hugging Face download already creates the
directory (`hf_utils.py`).

### Fix

- Restore `configs/dapo17k_trajectory_collection.yaml`. The validation
split is the `dapo17k` 0.0.1 `dapo17k_train.jsonl` artifact (the same
GitLab source as `dapo17k.yaml`), `num_repeats: 16`. Grading uses
math-verify only (`should_use_judge: false`), so
`judge_model_server.name` is `policy_model` and the README command needs
no override. The file has `description`/`value` and the
environment-server block like `dapo17k.yaml`. The `update-readme-table`
hook re-adds its root-README row.
- It keeps its own local file,
`data/dapo17k_trajectory_collection_train.jsonl`, as before NVIDIA-NeMo#859.
Collate checks each dataset against `<jsonl stem>_metrics.json`. Sharing
`dapo17k.yaml`'s `dapo17k_train.jsonl` would compare the ×16 validation
stats with that file's train sidecar and fail (`train != validation`,
`17398 != 278368`).
- Add `data/dapo17k_trajectory_collection_train_metrics.json`, written
by a real collate run (278368 rows = 17398 × 16). Its word and turn
statistics match `dapo17k_train_metrics.json` exactly, so the rows are
the same.
- README: the command is unchanged. One note says the GitLab downloads
in this README (the OpenMathReasoning download and this `--download`)
need the `mlflow` extra (optional since NVIDIA-NeMo#3547) and `mlflow_tracking_uri`
/ `mlflow_tracking_token` in `env.yaml`. The section says what it writes
and why the split is validation.

Test:
`tests/unit_tests/test_math_with_judge_readme_trajectory_config.py`
takes the README's `gym dataset collate` block and runs it through the
real CLI with `dispatch` intercepted. It resolves the config offline (no
`env.yaml`), checks the single dataset is `validation` ×16 with
`dapo17k.yaml`'s GitLab identifier, and checks the committed sidecar
describes that split. It then runs `TrainDataProcessor` on a three-row
fixture in a temporary directory, without network access, and checks
that only `validation.jsonl` and its metrics come out, with each
question repeated 16 times in order.

- `download_jsonl_dataset` now creates the output's parent directory, as
the Hugging Face download does. A new test in
`tests/unit_tests/test_gitlab_utils.py` fakes the registry lookup and
the HTTP fetch, then downloads into a missing nested directory. It fails
before this change with the same `FileNotFoundError` and passes after.

These plausible wrong fixes all fail the trajectory test:
- restoring the file verbatim (`???`);
- pointing the README at `dapo17k.yaml` with a judge override;
- `num_repeats: 1`;
- a `train` split;
- sharing `dapo17k_train.jsonl`.

### Before the fix

Gym `977583d3d` (`main`), the README command from the Gym root:

```bash
gym dataset collate \
    --config resources_servers/math_with_judge/configs/dapo17k_trajectory_collection.yaml \
    --config responses_api_models/openai_model/configs/openai_model.yaml \
    --output-dir data/dapo17k_trajectory_collection \
    --mode train_preparation \
    --download
```

```text
nemo_gym.config_types.ConfigPathNotFoundError: config_paths entry 'resources_servers/math_with_judge/configs/dapo17k_trajectory_collection.yaml' was not found. Looked in:
  - <gym>/resources_servers/math_with_judge/configs/dapo17k_trajectory_collection.yaml
Check the path is spelled correctly and is relative to your working directory, an extra root
(NEMO_GYM_EXTRA_ROOTS / --search-dir), or the Gym install root.
EXIT=1
```

The README's OpenMathReasoning GitLab download, from a directory without
`data/`, same base:

```bash
gym dataset download --storage gitlab --name math_open_math_reasoning --revision 0.0.1 \
    --artifact open_math_reasoning_problems.jsonl --output data/open_math_reasoning_problems.jsonl
```

```text
  File ".../nemo_gym/gitlab_utils.py", line 111, in download_jsonl_dataset
    with open(config.output_fpath, "w") as f:
FileNotFoundError: [Errno 2] No such file or directory: '<workspace>/data/open_math_reasoning_problems.jsonl'
```

### After the fix

This branch, same command, with the `mlflow` extra and GitLab registry
credentials in `env.yaml`. No local data beforehand:

```text
Downloading dataset `validation` for `math_with_judge_simple_agent` from gitlab using dataset_name='dapo17k' version='0.0.1' artifact_fpath='dapo17k_train.jsonl' output_fpath='resources_servers/math_with_judge/data/dapo17k_trajectory_collection_train.jsonl'
Dataset validation repeating 16x: each line repeated 16 times (e.g. pattern: abc -> aaaabbbbcccc)
Aggregate metrics for resources_servers/math_with_judge/data/dapo17k_trajectory_collection_train_metrics.json
Aggregate metrics for data/dapo17k_trajectory_collection/validation_metrics.json
EXIT=0
$ wc -l data/dapo17k_trajectory_collection/validation.jsonl
278368 data/dapo17k_trajectory_collection/validation.jsonl
```

There are 17398 runs of identical questions, each 16 rows long, and no
`train.jsonl`. A second run skips the download, reports the sidecar
`already up to date`, and exits 0.

The OpenMathReasoning download, same command and directory: exit 0, with
the file written (the QA case below checks its rows).

### Validation

- QA testcase `math_with_judge`, which runs both README GitLab steps
from a scratch directory with registry credentials:
- base `977583d3d`: 0/2. Trajectory collation fails because the config
is missing; the download fails with `FileNotFoundError`.
- this branch: 2/2. The download passes in 4.4 s; the trajectory
collation passes in 20.3 s with 17398 × 16 rows and the committed
sidecar unchanged.
  - The QA-suite change ships separately.
- New tests: trajectory test before 1 failed
(`ConfigPathNotFoundError`), after 1 passed, and the five wrong fixes
above fail it. Downloader test before 1 failed (`FileNotFoundError`),
after 1 passed, also with the real `mlflow` 3.16.1 installed.
- `test_train_data_utils.py`, `test_cli_main.py`,
`test_global_config.py`, `test_dataset_source.py`,
`test_task_data.py::TestSchemaPresence`, `test_ray_opt_out.py`,
`test_cli_resources_servers.py`, `test_model_registry.py`,
`test_resources_server_registry.py`, `test_environment_scaffold.py`,
`test_gitlab_utils.py`, `test_hf_utils.py`, and the new tests: 592
passed.
- `pre-commit run --all-files`: passed.
- Rollout evidence: N/A. This is a config and docs change, and `gym
dataset collate` runs no model. The full download-and-collate run above
uses the real registry data.

### Compatibility

A new config file. Nothing that loads other configs changes. GitLab
downloads now create a missing output directory instead of failing. The
restored config uses the same GitLab artifact as `dapo17k.yaml`, but a
separate local file, so each keeps its own metrics sidecar.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: qiaochuz <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
JeffPengCoder added a commit to JeffPengCoder/Gym that referenced this pull request Nov 10, 2026
The Qwen adapter decodes and resizes screenshots with Pillow, but the agent
declared only nemo-gym[dev]. Pillow used to arrive through mlflow's
matplotlib dependency; main now ships mlflow and wandb as optional extras
(NVIDIA-NeMo#3547), so a fresh web_agent venv could not import PIL and its tests failed
at collection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>
JeffPengCoder added a commit to JeffPengCoder/Gym that referenced this pull request Nov 11, 2026
The Qwen adapter decodes and resizes screenshots with Pillow, but the agent
declared only nemo-gym[dev]. Pillow used to arrive through mlflow's
matplotlib dependency; main now ships mlflow and wandb as optional extras
(NVIDIA-NeMo#3547), so a fresh web_agent venv could not import PIL and its tests failed
at collection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>
mpatel31415 added a commit to mpatel31415/Gym that referenced this pull request Nov 12, 2026
…NVIDIA-NeMo#2295)

* feat(webvoyager): add benchmark and shared web runtime

Add the WebVoyager benchmark, BrowserGym and native browser resource servers, external judge, shared web rollout agent and protocol, and the Nano Omni alignment profile. Preserve current upstream behavior while adding opt-in proxy support and safe validation diagnostics.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): avoid duplicate terminal evidence

Do not append the unchanged observation returned by an explicit native terminate action. Continue retaining valid observations from non-terminal actions that end the environment, while preserving the browser-target-closed safeguard. Add regression coverage for all three paths and structured runtime evidence logging.

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): align task-data schemas with current main

Declare the normalized web-task row contract for BrowserGym, native WebVoyager, and the external judge so main's schema drift gate validates committed datasets.

Move the ArXiv smoke dataset onto its judge resource server with an explicit agent pin, matching main's decoupled benchmark layout. Keep BrowserGym exports lazy so schema discovery remains dependency-light, and cover each committed web example dataset.

Signed-off-by: Jeff Peng <[email protected]>

* test(web): cover native browser runtime

Exercise native browser lifecycle, navigation, evidence capture, terminal handling, and computer actions. This restores the repository-wide CI coverage gate after adding the shared native browser driver.

Signed-off-by: Jeff Peng <[email protected]>

* docs(webvoyager): add native end-to-end runbook

Signed-off-by: Jeff Peng <[email protected]>

* docs(webvoyager): allowlist provenance hashes

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): make benchmark preparation self-contained

Download the pinned official 643-task source into Gym local ignored data storage, verify its checksum and denominator, and retain explicit source overrides.

Add a Fern end-to-end tutorial for both WebVoyager profiles and cover download caching, population validation, and the new navigation entry.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): fetch native benchmark data

Download the pinned 552-task native WebVoyager source directly during preparation, while retaining verified offline-source overrides. Keep the source lock, E2E docs, and regression tests aligned with the executable path.

Signed-off-by: Jeff Peng <[email protected]>

* chore(webvoyager): keep source lock scan stable

Place the informational raw URL after the existing SHA field so the pinned secret-scanner false-positive remains on its baseline line. The exact CI detector then passes without a repository-wide baseline rewrite.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): make component tests self-contained

Install pytest and pytest-asyncio in the native WebVoyager browser component so gym env test executes with the component CPython 3.13 environment instead of falling back to an unrelated global pytest interpreter.

Signed-off-by: Jeff Peng <[email protected]>

* refactor(webvoyager): unify the visual browser runtime

Remove the duplicate BrowserGym path and consolidate WebVoyager on a model-neutral visual_browser resource with shared computer-use actions.

Add bounded browser-session provider lifecycle and per-session operation isolation so local Chromium remains serialized per display while remote or AgentEnv-backed providers can be integrated without blocking the async service.

Add separate Nano Omni and Qwen 3.5 policy profiles on the shared runtime, consolidate benchmark preparation and judge configuration, and update the Fern runbook and regression coverage.

Validation: 250 focused WebVoyager tests passed; pre-commit passed; full 552-task Qwen and Nano Omni rollouts used the matching frozen source snapshot.
Signed-off-by: Jeff Peng <[email protected]>

* docs(webvoyager): record unified runtime validation

Signed-off-by: Jeff Peng <[email protected]>

* Make WebVoyager parsing parser-faithful

Treat the configured model-server reasoning and tool parsers as the authoritative output boundary. Remove Gym-side JSON, delimiter, and tool-alias repair, and reject out-of-contract scroll values instead of silently clamping them. Update the Nano Omni profile, documentation, and regression tests accordingly.

Signed-off-by: Jeff Peng <[email protected]>

* Document parser-faithful WebVoyager validation

Signed-off-by: Jeff Peng <[email protected]>

* Consolidate WebVoyager documentation

Signed-off-by: Jeff Peng <[email protected]>

* Simplify WebVoyager benchmark configuration and tooling

Consolidate dataset and policy provenance into one manifest consumed by prepare.py, and fold the Nano Omni transport override into its main profile without changing sampling or browser behavior.

Remove benchmark-local summary and CapSolver account-smoke scripts. Document the generated env.yaml and standard Gym aggregation and health-check workflow in README and Fern.

Relocate the existing eight provenance hash findings in the secrets baseline to their new file and line numbers. Preserve the scanner configuration and all unrelated entries; no additional value is allowlisted.

Validation: 276 benchmark and CLI tests passed; standard prepare produced 552 tasks; Fern reported zero errors; all-file pre-commit and the targeted secrets hook passed.
Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): address documentation and inline allowlist review

Keep the complete WebVoyager setup, smoke, full-population execution and
reconciliation guide in the benchmark README. Remove the duplicate Fern
page and retain a link from the evaluation index. Clarify that both policy
profiles connect to separately managed model endpoints; Gym does not
allocate GPUs or launch their vLLM servers.

Convert the provenance manifest from JSON to YAML so the eight non-secret
Git revisions and SHA-256 checksums can carry inline allowlist comments.
Update the loader, tests and documentation, and restore the global secrets
baseline byte-for-byte to the PR base without touching upstream findings.

All provenance values and types, the 552 prepared task rows and both
generated policy configurations remain identical to the previous revision.
Browser, agent, model and judge runtime behavior is unchanged.

Validation:
- 99 benchmark, CLI and Fern-link tests passed, plus 20 subtests.
- Repository-wide pre-commit and PR-scoped detect-secrets checks passed.
- Removing each inline annotation re-exposes exactly its former finding.
- Fern check reported zero errors; authenticated redirect check was skipped.

Addresses PR NVIDIA-NeMo#2295 discussions r3985809661 and r3985810226.

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): evaluate terminal policy errors without repairing model output

Treat context exhaustion as a truncated rollout and evaluate retained state, including first-turn rejection. Recognize newer vLLM decoder-prompt errors. Preserve parser output and remove duplicate action echo from Nano observations.

Expose matched agent/resource call limits and opt-in stop-and-evaluate semantics for invalid structured calls. Execute only the complete validated prefix before the first invalid call; never repair arguments or execute later calls. Existing retry and call-count defaults remain unchanged.

Validation: 295 focused tests passed; pre-commit --all-files passed. Full r2 WebArena evidence is 397/812 with no invalid samples, but the complete successor changes are not yet full-benchmark qualified.
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): retain browser session ownership through cancellation and cleanup

Address the operational failure modes discussed in issue NVIDIA-NeMo#2921 without copying its implementation. Allocate caller identity before seed, retain seed and close tasks independently of HTTP waiters, and authorize cookie-less cleanup with a redacted close capability. Bound tombstone retention and automatic retries without expiring active rollouts.

Retain failed provider, backend, executor and site cleanup handles until release succeeds. Keep occupied admission capacity and report session_lost or session_release_failed separately from valid task rewards. Check the exact Playwright-matched headed Chromium executable at startup, with serialized bounded auto-install and an offline fail-fast option.

Preserve task data, prompt, action parsing, screenshot history, judge evidence and reward formulas. Add fault-injection tests and Fern lifecycle documentation. Validation: 710 targeted tests passed, pre-commit run --all-files passed, git diff --check passed. Real browser/model and trainer regression remain pending; in-memory ownership does not claim crash-proof remote lease recovery.

Signed-off-by: Jeff Peng <[email protected]>

* chore(web): declare Ray usage for the web servers

Main starts Ray only for servers that declare ray_enabled = True, and
test_shipped_server_classes_declare_ray_usage requires each shipped server
class to declare it on the class itself. The visual browser, the WebVoyager
judge and the web agent do not use Ray.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* chore(web_agent): declare its legacy-agent environment server

Main deprecates agents without an environment server, and
test_repository_configs_declare_every_environment_server fails for
web_agent.yaml. Add the legacy_agent relay block that
scripts/add_legacy_agent_environment_servers.py writes. Both WebVoyager
profiles resolve with the relay fronting their renamed benchmark agent and
without the deprecation warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web_agent): declare Pillow for the Qwen computer-use adapter

The Qwen adapter decodes and resizes screenshots with Pillow, but the agent
declared only nemo-gym[dev]. Pillow used to arrive through mlflow's
matplotlib dependency; main now ships mlflow and wandb as optional extras
(NVIDIA-NeMo#3547), so a fresh web_agent venv could not import PIL and its tests failed
at collection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* test(visual_browser): run the resources server tests in its own venv

The visual browser resources server shipped no tests of its own, so
`gym env test` exited with pytest's "no tests collected" code, which the
server suites report as missing tests. Move the two test modules that cover
this server from tests/unit_tests into resources_servers/visual_browser/tests,
next to the code and dependencies they exercise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): namespace web-only failure kinds as web:<kind>

Main's failure vocabulary warns once per unregistered failure_kind and counts
it under "unregistered" in rollout telemetry. Keep the registered names the web
components already use (session_lost, session_release_failed, verifier_error,
transport_timeout, judge_failed, judge_unparseable) and emit every web-only
kind in main's namespaced form: web:model_quota_exhausted,
web:model_context_overflow, web:captcha_budget_exhausted,
web:missing_verifier_result, web:missing_judge_evidence and
web:external_judge_required.

Resources-server HTTP error bodies keep their error_kind values; the web agent
namespaces them where they become a failure_kind, so new error kinds are
covered too. Runtime statuses and truncation reasons are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): record browser video when record_video is enabled

record_video was accepted in the visual browser configuration but never passed
to Playwright, so the recording artifacts that /close reports, and the web
agent copies into its result, were always empty. When enabled, record the
context at viewport size into the session's video directory. Playwright
finishes the file when the context closes, before /close lists recordings.
The default stays off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web_agent): retry rollouts that ended on an unreachable site

When the browser exhausted its CAPTCHA failure budget, or a run ended without
a verdict, the agent returned a masked result row. The collector persists
every result row as finished, so resume never ran the task again and it left
the denominator silently, contrary to the README's "routed to retry".

Mark both cases with _ng_failure_class=retryable_infrastructure, as judge
failures already are. The collector writes them to the failures sidecar, and
resume runs them again with a fresh session within its attempt limit. They are
not marked terminal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): run a failed seed again once its cleanup finishes

WebSessionControl kept the finished seed task per session identity and
replaced it only after a CapacityUnavailableError. The web agent reuses one
identity for every seed retry, so any other seed failure was replayed from
the cache until the agent's retry budget ran out. In a full WebVoyager run, a
single navigation error (net::ERR_SOCKET_NOT_CONNECTED) on the first seed
cost the whole 1800 s budget, and the row could only be recovered by a
second wave.

Replay only a successful seed. A failed or cancelled seed runs again once the
manager reports its cleanup finished (can_retry_seed); until then a retry
receives the same failure, so a retry can never start a second browser while
the failed one still holds its lease. The agent retries only 5xx responses,
so deterministic 4xx failures are not seeded again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* feat(webvoyager): render dated questions for a reference date

79 Booking and Google Flights questions name absolute check-in, departure
or return dates. The pinned source renders them from its
template/webvoyager.template.jsonl for 2026-07-26, so they expire: a run on
2026-10-10 found 38 dates in the past, and all 38 tasks failed, 30 at the
100-step limit, because the live sites cannot search a past date.

prepare.py now downloads the hash-pinned template from the same source
commit, checks that it reproduces every source question for 2026-07-26, and
renders the questions again for reference_date in provenance.yaml
(2026-10-11, 11 weeks later; the closest date is 2026-11-10). Only the dates
change; original_metadata keeps the source question. The reference date must
be whole weeks after the source's, so weekdays, including the two "weekend"
questions, are unchanged, and preparation fails when a rendered date is not
after today. --reference-date renders for a later run.

The renderer matches the source's render_webvoyager.py for every template
entry and every reference date from 2026-01-01 through 2029-12-30. For
2026-07-26 the prepared file is byte-identical to the previous population
(SHA-256 bf61d491...); for 2026-10-11 only those 79 intents differ
(SHA-256 951bfe5c...).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* feat(visual_browser): lease one browser instance process per session

A headed PyAutoGUI driver acts on its process's X display, so a
visual_browser resources server could hold one session. Add a browser
instance: a single-threaded HTTP server with its own display that hosts
the unchanged web backend (WebVoyager driver plus evaluator) for one
session at a time. RemoteWebBackend forwards reset/observe/step/evaluate/
close to a leased instance, and the local_instance_pool provider keeps N
instances (Xvfb + server each), reuses healthy idle ones and restarts the
rest. max_sessions may exceed 1 when the provider is not local_process.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): a failed instance close does not hold a session slot

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): give each browser instance its own Xauthority file

python-xlib, which PyAutoGUI uses, fails without one even though Xvfb
runs with -ac; the per-worker launcher always created an empty file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* build(visual_browser): add a runtime image for browser instances

Base is Playwright's own v1.55.0-noble image, whose Chromium-1187 matches
the cache of the WebVoyager 552 reference runs file for file. Adds the
reference image's X tools and fonts, Python 3.13.14 and the
visual_browser component with dependencies pinned to the reference venv.
The build script sends only committed files as the context and can
convert the image to an enroot squashfs for Pyxis.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): image context has no resources_servers/__init__.py

resources_servers is a namespace package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): include cache/ in the image context

The root pyproject puts egg-info under cache/ (egg_base), so the
editable install needs that directory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): check the image's imports under Xvfb

pyautogui opens the X display at import time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): keep INFO logs of the driver inside a browser instance

Importing nemo_gym configures the root logger first, so the instance's
basicConfig was a no-op and every INFO record (step, CAPTCHA, close) of
the driver running in the instance was dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* feat(web): optional per-site session limit (site_pool_mode: site_limits)

Public sites rate-limit by client IP. With one shared rollout queue, the
instance-pool runtime ran up to 8 concurrent GitHub and Hugging Face
sessions from one egress IP (the per-worker layout ran 4-7) and drew
about twice the rate-limit pages. site_limits caps concurrent sessions
per task site (max_sessions_per_site, default 4); a seed for a full site
is rejected as capacity-unavailable so the agent backs off and retries,
and other sites are not blocked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* build(webvoyager): lock component venv package versions

The component servers run from venvs that Gym resolves when it first builds
them, outside `uv sync --frozen`. Between the 2026-10-11 reference runtime and
the 2026-10-17 instance-host runtime they drifted by 20+ minor releases per
component (pillow 12.3.0 -> 13.0.0, aiohttp, fastapi, pydantic, ...). Full
WebVoyager runs on the drifted venvs had 12-17 rollouts with unparseable model
actions against 1-8 on the reference venvs; with the venvs pinned back to the
reference versions the instance-host run had 4 (32 sessions per arm, 423/552 vs
control 421/552).

- benchmarks/webvoyager/component-constraints.txt: the versions of the six
  reference component venvs (151 packages), for UV_CONSTRAINT at venv build
  time. grpcio is pinned to 1.84.0 for all components (two reference venvs had
  1.85.0rc1).
- visual_browser image lock: same versions as the constraints. The image built
  from e0b894a still carries the drifted versions in its own interpreter; runs
  use the component venvs, not that interpreter.
- README: how to apply the constraints; test: the constraints are exact pins and
  the image lock agrees with them.

Checked: `uv pip compile` of all six components with the constraints
(python 3.13.14, x86_64 manylinux) resolves to exactly the reference venvs
except pip (seeded) and the planned grpcio pin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): pin huggingface-hub to main's version in the component lock

After the merge of main at b3103ea, nemo-gym requires huggingface-hub<2,
so the lock's huggingface-hub==2.2.0 (from the 2026-10-11 reference venvs)
made every component that installs nemo-gym[dev] unresolvable. The release
verification build on cw-dfw failed on it for openai_model.

Pin 1.33.0, the root uv.lock version, in the component constraints and the
visual-browser image lock. All six WebVoyager components resolve again with
the lock (Python 3.13.14, x86_64 manylinux); every other package that still
resolves keeps its reference version (pillow 12.3.0, ...). Packages that the
merged tree no longer installs in these components (ray and its dependencies,
now an extra) keep their pins, which have no effect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): track active tabs and honor runtime wait budgets

Follow live focused tabs after GUI actions without stealing focus, and distinguish closed tabs from lost browsers during capture and CAPTCHA handling. Advertise and enforce configurable per-action and per-step wait limits so sites asking for a 60-second retry can be handled without rewriting model actions.

Preserve specific termination reasons, expose process-local site-limit scope, and add sanitized serving completion diagnostics. Add opt-in malformed-judge retries under one deadline and masking after exhaustion while retaining legacy defaults. No JSON repair, EOS override, model checkpoint, or historical benchmark record is changed.

Validation: 692 focused web, resource, agent, judge and vLLM tests passed; changed-file hooks and repository-wide pre-commit passed. Live 552-task model/browser qualification is pending in a separate experiment, not implied by unit tests.
Signed-off-by: Jeff Peng <[email protected]>

* docs(webvoyager): record completed 552-task runtime validation

Record 418/552 = 75.72% on frozen runtime commit 60fa5e3 and the reference-date-2026-10-11 task population. Distinguish the tuned checkpoint from public v3, preserve first-valid zero-reward outcomes, and disclose the append-only recovery and observed successor handoff. No runtime behavior or deployment assets change.

Validation: 37 WebVoyager benchmark tests and repository-wide pre-commit passed. The full 552-task rollout was evaluated at 60fa5e3; this commit only records that evidence.
Signed-off-by: Jeff Peng <[email protected]>

* refactor(web): align runtime with current Gym packages

Signed-off-by: Jeff Peng <[email protected]>

* build(webvoyager): align browser build contracts with current main

Signed-off-by: Jeff Peng <[email protected]>

* build(webvoyager): follow managed component lock conventions

Signed-off-by: Jeff Peng <[email protected]>

* build(webvoyager): use managed component lock in browser image

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): preserve terminal evidence and fence cancelled mutations

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): classify the complete judge deadline

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): persist consistent grades after rejudgment

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): align component locks with main OpenAI SDK

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): resolve middleware and release validation failures

Keep bearer authentication and downstream ASGI handling in the caller task,
with regression coverage for context propagation, public paths and streaming.
Use neutral reference wording without changing dependency pins or results.

Consume the member-reviewed changelog file repair from FW-CI-templates#619
at a689c8faa078c7aa501442ca40bd8232eb4b2700. That commit adds only the
release finalizer repair and its six contract tests to the prior template pin.

Co-authored-by: Martyna Patelka <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(ci): pin release finalizer with explicit changelog state

Signed-off-by: Jeff Peng <[email protected]>

* ci: use merged release workflow pin

Apply Oliver’s suggested FW-CI-templates mainline pin 1ea89871720f31b9cacfd40655ad5151edd8be6f. It retains the changelog file transport and generated-state fixes from NVIDIA-NeMo#620.

Validation: 10 release finalizer tests pass; all pre-commit hooks pass.
Signed-off-by: Jeff Peng <[email protected]>

* test(web): include browser policy in core coverage

Move CPU-only visual browser and CAPTCHA tests into the benchmark core suite so their coverage is included by the core+sandbox gate. Retain the server packaging contract and add provider failure, polling deadline, proxy, cookie and token injection cases.

Validation: 53 focused core tests and 1,347 related regression tests pass; pre-commit --all-files passes. Combining the original five CI coverage artifacts with the new local core coverage passes the unchanged 95% gate at 95.19% (76,057 statements, 3,659 missed).
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): preserve judge validity and browser lease ownership

Integrate the prepared seven-finding repair from NVIDIA-NeMo#2295 (comment). Mask missing required judge screenshots, align dataset evidence limits, retain recycling across cancelled release/close waiters, isolate lease generations, parse Qwen actions from final output, and keep deterministic argument failures on the policy parse path.

Validation: 200 focused tests and 1,523 broader browser, agent, judge, schema and public API regression tests pass; pre-commit --all-files passes. Targeted real-process cancellation/recycling validation remains in progress.

Co-authored-by: Martyna Patelka <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* test(web): wait for browser instance fixture readiness

Wait for the real health endpoint before yielding the threaded HTTP fixture. This prevents the reset request from racing socket binding under parallel CI load. A delayed-server probe reproduces the original failure and passes with the readiness wait; all 26 browser-instance and pool tests pass.

Signed-off-by: Jeff Peng <[email protected]>

---------

Signed-off-by: Jeff Peng <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Martyna Patelka <[email protected]>
rystewart-nvidia pushed a commit to rystewart-nvidia/Gym that referenced this pull request Nov 13, 2026
)

* feat(webvoyager): add benchmark and shared web runtime

Add the WebVoyager benchmark, BrowserGym and native browser resource servers, external judge, shared web rollout agent and protocol, and the Nano Omni alignment profile. Preserve current upstream behavior while adding opt-in proxy support and safe validation diagnostics.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): avoid duplicate terminal evidence

Do not append the unchanged observation returned by an explicit native terminate action. Continue retaining valid observations from non-terminal actions that end the environment, while preserving the browser-target-closed safeguard. Add regression coverage for all three paths and structured runtime evidence logging.

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): align task-data schemas with current main

Declare the normalized web-task row contract for BrowserGym, native WebVoyager, and the external judge so main's schema drift gate validates committed datasets.

Move the ArXiv smoke dataset onto its judge resource server with an explicit agent pin, matching main's decoupled benchmark layout. Keep BrowserGym exports lazy so schema discovery remains dependency-light, and cover each committed web example dataset.

Signed-off-by: Jeff Peng <[email protected]>

* test(web): cover native browser runtime

Exercise native browser lifecycle, navigation, evidence capture, terminal handling, and computer actions. This restores the repository-wide CI coverage gate after adding the shared native browser driver.

Signed-off-by: Jeff Peng <[email protected]>

* docs(webvoyager): add native end-to-end runbook

Signed-off-by: Jeff Peng <[email protected]>

* docs(webvoyager): allowlist provenance hashes

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): make benchmark preparation self-contained

Download the pinned official 643-task source into Gym local ignored data storage, verify its checksum and denominator, and retain explicit source overrides.

Add a Fern end-to-end tutorial for both WebVoyager profiles and cover download caching, population validation, and the new navigation entry.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): fetch native benchmark data

Download the pinned 552-task native WebVoyager source directly during preparation, while retaining verified offline-source overrides. Keep the source lock, E2E docs, and regression tests aligned with the executable path.

Signed-off-by: Jeff Peng <[email protected]>

* chore(webvoyager): keep source lock scan stable

Place the informational raw URL after the existing SHA field so the pinned secret-scanner false-positive remains on its baseline line. The exact CI detector then passes without a repository-wide baseline rewrite.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): make component tests self-contained

Install pytest and pytest-asyncio in the native WebVoyager browser component so gym env test executes with the component CPython 3.13 environment instead of falling back to an unrelated global pytest interpreter.

Signed-off-by: Jeff Peng <[email protected]>

* refactor(webvoyager): unify the visual browser runtime

Remove the duplicate BrowserGym path and consolidate WebVoyager on a model-neutral visual_browser resource with shared computer-use actions.

Add bounded browser-session provider lifecycle and per-session operation isolation so local Chromium remains serialized per display while remote or AgentEnv-backed providers can be integrated without blocking the async service.

Add separate Nano Omni and Qwen 3.5 policy profiles on the shared runtime, consolidate benchmark preparation and judge configuration, and update the Fern runbook and regression coverage.

Validation: 250 focused WebVoyager tests passed; pre-commit passed; full 552-task Qwen and Nano Omni rollouts used the matching frozen source snapshot.
Signed-off-by: Jeff Peng <[email protected]>

* docs(webvoyager): record unified runtime validation

Signed-off-by: Jeff Peng <[email protected]>

* Make WebVoyager parsing parser-faithful

Treat the configured model-server reasoning and tool parsers as the authoritative output boundary. Remove Gym-side JSON, delimiter, and tool-alias repair, and reject out-of-contract scroll values instead of silently clamping them. Update the Nano Omni profile, documentation, and regression tests accordingly.

Signed-off-by: Jeff Peng <[email protected]>

* Document parser-faithful WebVoyager validation

Signed-off-by: Jeff Peng <[email protected]>

* Consolidate WebVoyager documentation

Signed-off-by: Jeff Peng <[email protected]>

* Simplify WebVoyager benchmark configuration and tooling

Consolidate dataset and policy provenance into one manifest consumed by prepare.py, and fold the Nano Omni transport override into its main profile without changing sampling or browser behavior.

Remove benchmark-local summary and CapSolver account-smoke scripts. Document the generated env.yaml and standard Gym aggregation and health-check workflow in README and Fern.

Relocate the existing eight provenance hash findings in the secrets baseline to their new file and line numbers. Preserve the scanner configuration and all unrelated entries; no additional value is allowlisted.

Validation: 276 benchmark and CLI tests passed; standard prepare produced 552 tasks; Fern reported zero errors; all-file pre-commit and the targeted secrets hook passed.
Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): address documentation and inline allowlist review

Keep the complete WebVoyager setup, smoke, full-population execution and
reconciliation guide in the benchmark README. Remove the duplicate Fern
page and retain a link from the evaluation index. Clarify that both policy
profiles connect to separately managed model endpoints; Gym does not
allocate GPUs or launch their vLLM servers.

Convert the provenance manifest from JSON to YAML so the eight non-secret
Git revisions and SHA-256 checksums can carry inline allowlist comments.
Update the loader, tests and documentation, and restore the global secrets
baseline byte-for-byte to the PR base without touching upstream findings.

All provenance values and types, the 552 prepared task rows and both
generated policy configurations remain identical to the previous revision.
Browser, agent, model and judge runtime behavior is unchanged.

Validation:
- 99 benchmark, CLI and Fern-link tests passed, plus 20 subtests.
- Repository-wide pre-commit and PR-scoped detect-secrets checks passed.
- Removing each inline annotation re-exposes exactly its former finding.
- Fern check reported zero errors; authenticated redirect check was skipped.

Addresses PR NVIDIA-NeMo#2295 discussions r3985809661 and r3985810226.

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): evaluate terminal policy errors without repairing model output

Treat context exhaustion as a truncated rollout and evaluate retained state, including first-turn rejection. Recognize newer vLLM decoder-prompt errors. Preserve parser output and remove duplicate action echo from Nano observations.

Expose matched agent/resource call limits and opt-in stop-and-evaluate semantics for invalid structured calls. Execute only the complete validated prefix before the first invalid call; never repair arguments or execute later calls. Existing retry and call-count defaults remain unchanged.

Validation: 295 focused tests passed; pre-commit --all-files passed. Full r2 WebArena evidence is 397/812 with no invalid samples, but the complete successor changes are not yet full-benchmark qualified.
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): retain browser session ownership through cancellation and cleanup

Address the operational failure modes discussed in issue NVIDIA-NeMo#2921 without copying its implementation. Allocate caller identity before seed, retain seed and close tasks independently of HTTP waiters, and authorize cookie-less cleanup with a redacted close capability. Bound tombstone retention and automatic retries without expiring active rollouts.

Retain failed provider, backend, executor and site cleanup handles until release succeeds. Keep occupied admission capacity and report session_lost or session_release_failed separately from valid task rewards. Check the exact Playwright-matched headed Chromium executable at startup, with serialized bounded auto-install and an offline fail-fast option.

Preserve task data, prompt, action parsing, screenshot history, judge evidence and reward formulas. Add fault-injection tests and Fern lifecycle documentation. Validation: 710 targeted tests passed, pre-commit run --all-files passed, git diff --check passed. Real browser/model and trainer regression remain pending; in-memory ownership does not claim crash-proof remote lease recovery.

Signed-off-by: Jeff Peng <[email protected]>

* chore(web): declare Ray usage for the web servers

Main starts Ray only for servers that declare ray_enabled = True, and
test_shipped_server_classes_declare_ray_usage requires each shipped server
class to declare it on the class itself. The visual browser, the WebVoyager
judge and the web agent do not use Ray.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* chore(web_agent): declare its legacy-agent environment server

Main deprecates agents without an environment server, and
test_repository_configs_declare_every_environment_server fails for
web_agent.yaml. Add the legacy_agent relay block that
scripts/add_legacy_agent_environment_servers.py writes. Both WebVoyager
profiles resolve with the relay fronting their renamed benchmark agent and
without the deprecation warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web_agent): declare Pillow for the Qwen computer-use adapter

The Qwen adapter decodes and resizes screenshots with Pillow, but the agent
declared only nemo-gym[dev]. Pillow used to arrive through mlflow's
matplotlib dependency; main now ships mlflow and wandb as optional extras
(NVIDIA-NeMo#3547), so a fresh web_agent venv could not import PIL and its tests failed
at collection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* test(visual_browser): run the resources server tests in its own venv

The visual browser resources server shipped no tests of its own, so
`gym env test` exited with pytest's "no tests collected" code, which the
server suites report as missing tests. Move the two test modules that cover
this server from tests/unit_tests into resources_servers/visual_browser/tests,
next to the code and dependencies they exercise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): namespace web-only failure kinds as web:<kind>

Main's failure vocabulary warns once per unregistered failure_kind and counts
it under "unregistered" in rollout telemetry. Keep the registered names the web
components already use (session_lost, session_release_failed, verifier_error,
transport_timeout, judge_failed, judge_unparseable) and emit every web-only
kind in main's namespaced form: web:model_quota_exhausted,
web:model_context_overflow, web:captcha_budget_exhausted,
web:missing_verifier_result, web:missing_judge_evidence and
web:external_judge_required.

Resources-server HTTP error bodies keep their error_kind values; the web agent
namespaces them where they become a failure_kind, so new error kinds are
covered too. Runtime statuses and truncation reasons are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): record browser video when record_video is enabled

record_video was accepted in the visual browser configuration but never passed
to Playwright, so the recording artifacts that /close reports, and the web
agent copies into its result, were always empty. When enabled, record the
context at viewport size into the session's video directory. Playwright
finishes the file when the context closes, before /close lists recordings.
The default stays off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web_agent): retry rollouts that ended on an unreachable site

When the browser exhausted its CAPTCHA failure budget, or a run ended without
a verdict, the agent returned a masked result row. The collector persists
every result row as finished, so resume never ran the task again and it left
the denominator silently, contrary to the README's "routed to retry".

Mark both cases with _ng_failure_class=retryable_infrastructure, as judge
failures already are. The collector writes them to the failures sidecar, and
resume runs them again with a fresh session within its attempt limit. They are
not marked terminal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): run a failed seed again once its cleanup finishes

WebSessionControl kept the finished seed task per session identity and
replaced it only after a CapacityUnavailableError. The web agent reuses one
identity for every seed retry, so any other seed failure was replayed from
the cache until the agent's retry budget ran out. In a full WebVoyager run, a
single navigation error (net::ERR_SOCKET_NOT_CONNECTED) on the first seed
cost the whole 1800 s budget, and the row could only be recovered by a
second wave.

Replay only a successful seed. A failed or cancelled seed runs again once the
manager reports its cleanup finished (can_retry_seed); until then a retry
receives the same failure, so a retry can never start a second browser while
the failed one still holds its lease. The agent retries only 5xx responses,
so deterministic 4xx failures are not seeded again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* feat(webvoyager): render dated questions for a reference date

79 Booking and Google Flights questions name absolute check-in, departure
or return dates. The pinned source renders them from its
template/webvoyager.template.jsonl for 2026-07-26, so they expire: a run on
2026-10-10 found 38 dates in the past, and all 38 tasks failed, 30 at the
100-step limit, because the live sites cannot search a past date.

prepare.py now downloads the hash-pinned template from the same source
commit, checks that it reproduces every source question for 2026-07-26, and
renders the questions again for reference_date in provenance.yaml
(2026-10-11, 11 weeks later; the closest date is 2026-11-10). Only the dates
change; original_metadata keeps the source question. The reference date must
be whole weeks after the source's, so weekdays, including the two "weekend"
questions, are unchanged, and preparation fails when a rendered date is not
after today. --reference-date renders for a later run.

The renderer matches the source's render_webvoyager.py for every template
entry and every reference date from 2026-01-01 through 2029-12-30. For
2026-07-26 the prepared file is byte-identical to the previous population
(SHA-256 bf61d491...); for 2026-10-11 only those 79 intents differ
(SHA-256 951bfe5c...).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* feat(visual_browser): lease one browser instance process per session

A headed PyAutoGUI driver acts on its process's X display, so a
visual_browser resources server could hold one session. Add a browser
instance: a single-threaded HTTP server with its own display that hosts
the unchanged web backend (WebVoyager driver plus evaluator) for one
session at a time. RemoteWebBackend forwards reset/observe/step/evaluate/
close to a leased instance, and the local_instance_pool provider keeps N
instances (Xvfb + server each), reuses healthy idle ones and restarts the
rest. max_sessions may exceed 1 when the provider is not local_process.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): a failed instance close does not hold a session slot

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): give each browser instance its own Xauthority file

python-xlib, which PyAutoGUI uses, fails without one even though Xvfb
runs with -ac; the per-worker launcher always created an empty file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* build(visual_browser): add a runtime image for browser instances

Base is Playwright's own v1.55.0-noble image, whose Chromium-1187 matches
the cache of the WebVoyager 552 reference runs file for file. Adds the
reference image's X tools and fonts, Python 3.13.14 and the
visual_browser component with dependencies pinned to the reference venv.
The build script sends only committed files as the context and can
convert the image to an enroot squashfs for Pyxis.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): image context has no resources_servers/__init__.py

resources_servers is a namespace package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): include cache/ in the image context

The root pyproject puts egg-info under cache/ (egg_base), so the
editable install needs that directory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): check the image's imports under Xvfb

pyautogui opens the X display at import time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(visual_browser): keep INFO logs of the driver inside a browser instance

Importing nemo_gym configures the root logger first, so the instance's
basicConfig was a no-op and every INFO record (step, CAPTCHA, close) of
the driver running in the instance was dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* feat(web): optional per-site session limit (site_pool_mode: site_limits)

Public sites rate-limit by client IP. With one shared rollout queue, the
instance-pool runtime ran up to 8 concurrent GitHub and Hugging Face
sessions from one egress IP (the per-worker layout ran 4-7) and drew
about twice the rate-limit pages. site_limits caps concurrent sessions
per task site (max_sessions_per_site, default 4); a seed for a full site
is rejected as capacity-unavailable so the agent backs off and retries,
and other sites are not blocked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* build(webvoyager): lock component venv package versions

The component servers run from venvs that Gym resolves when it first builds
them, outside `uv sync --frozen`. Between the 2026-10-11 reference runtime and
the 2026-10-17 instance-host runtime they drifted by 20+ minor releases per
component (pillow 12.3.0 -> 13.0.0, aiohttp, fastapi, pydantic, ...). Full
WebVoyager runs on the drifted venvs had 12-17 rollouts with unparseable model
actions against 1-8 on the reference venvs; with the venvs pinned back to the
reference versions the instance-host run had 4 (32 sessions per arm, 423/552 vs
control 421/552).

- benchmarks/webvoyager/component-constraints.txt: the versions of the six
  reference component venvs (151 packages), for UV_CONSTRAINT at venv build
  time. grpcio is pinned to 1.84.0 for all components (two reference venvs had
  1.85.0rc1).
- visual_browser image lock: same versions as the constraints. The image built
  from e0b894a still carries the drifted versions in its own interpreter; runs
  use the component venvs, not that interpreter.
- README: how to apply the constraints; test: the constraints are exact pins and
  the image lock agrees with them.

Checked: `uv pip compile` of all six components with the constraints
(python 3.13.14, x86_64 manylinux) resolves to exactly the reference venvs
except pip (seeded) and the planned grpcio pin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): pin huggingface-hub to main's version in the component lock

After the merge of main at b3103ea, nemo-gym requires huggingface-hub<2,
so the lock's huggingface-hub==2.2.0 (from the 2026-10-11 reference venvs)
made every component that installs nemo-gym[dev] unresolvable. The release
verification build on cw-dfw failed on it for openai_model.

Pin 1.33.0, the root uv.lock version, in the component constraints and the
visual-browser image lock. All six WebVoyager components resolve again with
the lock (Python 3.13.14, x86_64 manylinux); every other package that still
resolves keeps its reference version (pillow 12.3.0, ...). Packages that the
merged tree no longer installs in these components (ray and its dependencies,
now an extra) keep their pins, which have no effect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): track active tabs and honor runtime wait budgets

Follow live focused tabs after GUI actions without stealing focus, and distinguish closed tabs from lost browsers during capture and CAPTCHA handling. Advertise and enforce configurable per-action and per-step wait limits so sites asking for a 60-second retry can be handled without rewriting model actions.

Preserve specific termination reasons, expose process-local site-limit scope, and add sanitized serving completion diagnostics. Add opt-in malformed-judge retries under one deadline and masking after exhaustion while retaining legacy defaults. No JSON repair, EOS override, model checkpoint, or historical benchmark record is changed.

Validation: 692 focused web, resource, agent, judge and vLLM tests passed; changed-file hooks and repository-wide pre-commit passed. Live 552-task model/browser qualification is pending in a separate experiment, not implied by unit tests.
Signed-off-by: Jeff Peng <[email protected]>

* docs(webvoyager): record completed 552-task runtime validation

Record 418/552 = 75.72% on frozen runtime commit 60fa5e3 and the reference-date-2026-10-11 task population. Distinguish the tuned checkpoint from public v3, preserve first-valid zero-reward outcomes, and disclose the append-only recovery and observed successor handoff. No runtime behavior or deployment assets change.

Validation: 37 WebVoyager benchmark tests and repository-wide pre-commit passed. The full 552-task rollout was evaluated at 60fa5e3; this commit only records that evidence.
Signed-off-by: Jeff Peng <[email protected]>

* refactor(web): align runtime with current Gym packages

Signed-off-by: Jeff Peng <[email protected]>

* build(webvoyager): align browser build contracts with current main

Signed-off-by: Jeff Peng <[email protected]>

* build(webvoyager): follow managed component lock conventions

Signed-off-by: Jeff Peng <[email protected]>

* build(webvoyager): use managed component lock in browser image

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): preserve terminal evidence and fence cancelled mutations

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): classify the complete judge deadline

Signed-off-by: Jeff Peng <[email protected]>

* fix(webvoyager): persist consistent grades after rejudgment

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): align component locks with main OpenAI SDK

Signed-off-by: Jeff Peng <[email protected]>

* feat(web): add WebArena visual browser benchmark

Signed-off-by: Jeff Peng <[email protected]>

* Align WebArena profile with parser-faithful agent

Remove the retired nano_omni_action_recovery and nano_omni_tool_alias_recovery options. The current shared agent ignores these fields and no longer repairs JSON or tool aliases; keeping them would misleadingly advertise behavior that is not executed.

Add an offline composed-profile regression test covering parser settings, resource routing, dataset path, and the preserved history-thinking transport option. Leave task data, evaluation, sampling, and parse-retry settings unchanged.

Validation: 291 focused Web unit, agent, benchmark, and evaluator tests passed; pre-commit run --all-files, uv lock --check --offline, scoped detect-secrets, and base-relative git diff --check passed. No new full WebArena rollout or success-rate result is claimed.
Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): align terminal policy and verify shopping authentication

False-positive shopping login admission exposed guest pages to the policy. Require the protected account URL and visible My Account heading, using existing bounded setup retries and closing failed pages.

Remove the implicit 16384 output cap, match agent/resource uncapped call-list admission, and stop then evaluate execution or invalid-call failures without correction feedback or temperature overrides. Preserve bounded missing-tool retries and original model output.

Validation: 15 focused benchmark/auth tests and pre-commit --all-files passed. These successor profile and auth changes still require a fresh full benchmark; do not attribute the preceding r2 397/812 score to the complete changes.
Signed-off-by: Jeff Peng <[email protected]>

* fix(web): make scroll limits configurable with bounded execution

The fixed 50-tick validator rejected parser-produced reference actions before execution. Add matching optional limits to the tool schema, agent and resource validators, retaining the existing default of 50. Explicitly relaxed profiles execute the original integer without JSON repair, clamping or automatic retries.

Execute relaxed scrolls in a direct child process with a configurable deadline. Timeout kills and reaps that child before capturing/evaluating the still-live browser, preventing an oversized PyAutoGUI scroll from outliving cancellation. Add regression coverage for strict defaults, schema isolation, exact arguments, child errors/timeouts and retained evaluation state.

Validated the exact frozen candidate with 190 focused tests, real remote Chromium/timeout gates, and all 812 WebArena tasks: 484 successes, zero invalid/missing/duplicate/retry tasks. Full pre-commit passes. Full local gym dev test reports 4616 passed, 151 skipped and 6 failures; all six reproduce on unchanged base d016328 in the same environment. Overall coverage is 89.02%, below the configured 95% gate; this is not a claim of a green full suite. The observed task-411 dialog callback issue is not modified here.

Signed-off-by: Jeff Peng <[email protected]>

* fix(web): tolerate already-closed browser dialogs

Task 411 exposed a stale dialog callback: PyAutoGUI can close a dialog before synchronous Playwright dispatches its queued event, causing Dialog.accept to report No dialog is showing.

Keep accepting normal dialogs exactly once. Tolerate only the exact observed Playwright protocol error, log the session/task/step/type and already_closed outcome, and propagate unrelated errors. Do not retry actions, refocus editors, change prompt handling or modify scoring. Avoid recording dialog text, prompt values or page URLs.

Add 17 regression cases covering all four normal dialog types across benchmark identities, stale-event state preservation, and unrelated errors. Validation: 207 focused tests and all applicable pre-commit hooks pass. An isolated real Chromium regression with Playwright 1.55.0 reproduces the legacy exception and verifies the candidate accepts normal dialogs, handles the stale event, and continues browser input and screenshot capture. No new model rollout or aggregate benchmark score is claimed.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): keep shared task schemas in the resource namespace

The main-sync full Linux suite exposed a semantic stack conflict: upstream now permits dependency-light task schemas to import only stdlib, pydantic, nemo_gym.task_data, or another resource server task_data module. The WebArena stack had moved the shared model into nemo_gym.web.task_data.

Restore ownership to visual_browser/task_data.py and have WebArena re-export that single definition. Preserve all schema fields, defaults, extra-field behavior and the complete generated JSON schema; do not relax the repository-wide import rule or alter prompts, tasks, actions or evaluators.

Validation: 340 task-data and web-schema tests passed; all-files pre-commit passed; old/new model_json_schema equality verified. Existing example-row and unknown-benchmark tests retained, with seven new identity/preservation cases. Full Linux CI and the 812-task regression will use a new frozen source candidate.
Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): check headed Chromium before accepting sessions

Wire the shared driver-matched Chromium startup check into the WebArena resources-server manager. Respect browser_auto_install for offline deployments and preserve the existing task validation, evaluator and site-isolation behavior. This wiring is used by VisualWebArena through its stacked parent as well.

Validated with the shared lifecycle patch: 404 WebArena/web tests passed and scoped pre-commit passed. The shared implementation is inherited from feature/webarena, not duplicated in this layer. Real-model regression remains pending.

Signed-off-by: Jeff Peng <[email protected]>

* chore(webarena): declare Ray usage for the WebArena browser server

Main starts Ray only for servers that declare ray_enabled = True, and
test_shipped_server_classes_declare_ray_usage requires each shipped server
class to declare it on the class itself. The WebArena browser server does
not use Ray, like the visual browser it extends.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Jeff Peng <[email protected]>

* refactor(webarena): follow current package and test imports

Signed-off-by: Jeff Peng <[email protected]>

* build(webarena): adopt managed browser component lock

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): reject invalid evaluator evidence and resolve snapshot keys

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): propagate candidate failures and document source license

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): align component lock with main OpenAI SDK

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): preserve empty DOM snapshots and valid member queries

Capture narrowly matched optional DOM read chains as a successful empty
baseline when the node is absent. Keep invalid selectors, browser failures
and arbitrary script errors inconclusive so they cannot fabricate mutations.
Correct the missing JavaScript empty-string literal in sync and async
GitLab member-role queries.

Add real Chromium regressions for empty-before/populated-after scoring,
unchanged empty controls, member roles and invalid selectors.
Validation on the current PR base: 79 component tests, 154 shared web
tests and 378 SDK compatibility tests passed; all-files pre-commit passed.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): make planned evaluator evidence authoritative

Score planned program-HTML, order and SKU-review captures from their deltas,
including conclusive empty and nonmatching deltas. Preserve final-state
scoring for targets without an applicable capture and reject unchanged text
carried into a changed line as fresh matching evidence.

Share optional DOM reads and member-role extraction between snapshots and
final evaluation. Propagate unavailable DOM evidence and invalid scripts
through the existing candidate-error aggregation, while keeping genuine
absence and healthy nonmatches valid scored outcomes.

Add public/sync/async regressions and real Chromium controls. Expose WebArena
from the Fern tutorial and environment indexes without changing shared config.

Validation: 264 component tests including 22 real Chromium cases and example
data validation; 154 shared Web tests; all-files pre-commit; Fern check.
The historical 475/812 remains attributed to frozen source 363bd7c, not this
revised evaluator. No new full-population score is claimed.

Review: NVIDIA-NeMo#2917 (comment)
Review: NVIDIA-NeMo#2917 (comment)
Review: NVIDIA-NeMo#2917 (comment)
Signed-off-by: Jeff Peng <[email protected]>

* chore(webarena): refresh checks after main retarget

Re-evaluate PR NVIDIA-NeMo#2917 checks after its native stack moved from the merged
feature/webarena branch to main. The initial DCO run evaluated the old base
and listed existing mainline author/sign-off identity mismatches. Direct
DCO re-request returned HTTP 404.

This commit has no file changes. Source tree remains
4bdd4c7, exactly the tree validated at
f8ce72b. No historical signature or
check result is modified.

Signed-off-by: Jeff Peng <[email protected]>

* docs(webarena): retain source provenance through public import record

Reference the immutable published import-provenance record at d46f2f6
from all three adapted-source headers and the provenance manifest.
Retain the original source revision, original module paths and hashes,
all file mappings, copyright notices and the complete original license.
The public permalink identifies the provenance record, not a different
upstream source revision.

All three complete Python module ASTs match the previously tested source;
the source-license bytes are unchanged. No scoring or browser behavior
changes. Keep the original source URL and license-verification locators
traceable through the immutable public record.

Validation: pinned FW-CI 7dd05d1e scanner with the unchanged current private
catalog reports zero locations across all 57 staged PR paths and the full
candidate description; all-files pre-commit and whitespace checks pass.
The prior 789 tests and attributed model-trace/15-browser-control evidence
remain tied to their executed source, with full-module AST equivalence.

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): validate snapshot navigation before scoring

Keep main-resource response status and landed URL in all four browser
snapshot collectors. Reject unavailable or unauthenticated captures,
including login documents served at the requested URL, and validate
baseline resource identity before the agent acts.

Preserve healthy empty captures, bounded site canonical redirects,
not-found resources before creation, and observable after-action 404s
and same-site deletion redirects as scored outcomes.

Cover all collectors and phase-aware resource identity checks, plus real
HTTP/Chromium before/after scoring regressions for the public and async
entrypoints. Retain the existing DOM-disconnect extraction boundary.

Addresses NVIDIA-NeMo#2917 (comment)

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): isolate target evidence from fallback documents

Do not extract target text or images from error documents or noncanonical
landing pages. Retain their navigation and target-document identity, and
normalize navigation-aware retained captures before deriving deltas.

Distinguish confirmed 404/410 absence from another resource's document.
Other-resource captures remain valid outcomes without supplying content
or proving an empty target. Allow a confirmed empty/absent target to
satisfy an empty deletion criterion only when it improves on the baseline.

Preserve the earlier service/auth guards, including recognizable login
forms served with a 404 response. Add actual HTTP/Chromium creation,
deletion, empty-value, redirect and image-evidence controls, with an
independent exact-source negative control.

Addresses NVIDIA-NeMo#2917 (comment)

Signed-off-by: Jeff Peng <[email protected]>

* fix(webarena): bind target absence to resource identity

Require both a 404/410 response and the existing requested/canonical URL
identity when attributing target absence. An unrelated missing landing
cannot prove that the requested target is empty or deleted.

Cover unrelated and accepted canonical missing-resource responses in
both production sync/public and async HTTP/Chromium scoring paths.

Addresses NVIDIA-NeMo#2917 (comment)

Signed-off-by: Jeff Peng <[email protected]>

---------

Signed-off-by: Jeff Peng <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

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

Labels

area:build Packaging, dependencies, containers, and releases bug Something isn't working complexity:medium Single-domain change with interacting parts or a moderate review surface waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make MLflow and Weights & Biases dependencies optional

5 participants