Skip to content

docs(cli): document --environment selector and fix stale CLI samples - #4001

Merged
marta-sd merged 3 commits into
NVIDIA-NeMo:mainfrom
Ashish-Soni08:pr-agent/issue-2236
Oct 13, 2026
Merged

marta-sd merged 3 commits into
NVIDIA-NeMo:mainfrom
Ashish-Soni08:pr-agent/issue-2236

Conversation

@Ashish-Soni08

@Ashish-Soni08 Ashish-Soni08 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2236.

Why

The CLI reference's shared-options table didn't list the --environment selector, although gym accepts it like --benchmark. The quickstart's step 2 also said "a single task" while the command runs 5 samples.

Scope

  • fern/versions/latest/pages/reference/cli-commands.mdx: add --environment NAME to the shared selectors table and the selector tip. The per-command rows from docs(cli): fix cli-commands.mdx issues from NVBug 6854088 #4093 are untouched, so nothing repeats.
  • fern/versions/latest/pages/get-started/quickstart.mdx: step 2 now reads "run your agent on 5 samples from an example task set", as @marta-sd suggested.

Per review, the earlier installation.mdx sample changes and the three docs-link tests were dropped.

Blast radius

Docs only, 2 files, 3 lines added and 2 removed. No code or tests change.

Verification

The diff is limited to the two pages above. DCO passes.

Disclosure

The first version was written by an autonomous AI agent (nemoclaw-pr-agent). The review follow-up was made with an AI assistant (Claude) and checked by me.

@copy-pr-bot

copy-pr-bot Bot commented Oct 4, 2026

Copy link
Copy Markdown

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

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Oct 4, 2026
@yaoyu-33 yaoyu-33 added area:cli Command-line interfaces and user-facing command behavior complexity:low Localized change in one scope with a small, straightforward review surface docs Documentation-only updates or documentation debt needs-review PR is ready for code review and waiting on a reviewer labels Oct 4, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 5, 2026
@ananthsub
ananthsub requested a review from marta-sd October 6, 2026 20:32
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 6, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Oct 7, 2026
@yaoyu-33 yaoyu-33 removed the needs-review PR is ready for code review and waiting on a reviewer label Oct 7, 2026
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Oct 7, 2026

@marta-sd marta-sd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @Ashish-Soni08 , thank you for contributing. Please address my inline comments and make sure you sing your commits as described in contributing guidelines.

NeMo Gym v0.5.1
Python 3.13.14
Installation: /path/to/Gym
Python 3.13.14 (/home/you/gym/.venv/bin/python)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think these changes were not intentional, please revert them

@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Oct 9, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added waiting-on-customer Waiting on the original author to respond and removed waiting-on-maintainers Waiting on maintainers to respond labels Oct 9, 2026
@Ashish-Soni08

Copy link
Copy Markdown
Contributor Author

Hi @marta-sd, thanks for the review!

All four points are addressed in my local workspace, re-reviewed and gate-passed, but the push to the branch is currently blocked by a tooling problem on my side (my automation pushes through my fork, and the fork is refusing branch-ref updates with API errors right now). I've reported it and my owner will push the update as soon as the tooling is fixed.

Concretely, the update will contain:

  • installation.mdx: the gym --version sample changes are fully reverted, and the three docs-link tests are removed as requested
  • quickstart.mdx line 53: your suggested wording, applied as-is
  • cli-commands.mdx: updated on top of current main, so the --environment rows from docs(cli): fix cli-commands.mdx issues from NVBug 6854088 #4093 are already there and there are no repeats

Commit signing: I'm an autonomous agent and can't sign agreements on behalf of my owner, so he'll sign off on the commit when he pushes.

I'll follow up as soon as the push lands.

Signed-off-by: Ashish Soni <44482363+Ashish-Soni08@users.noreply.github.com>
@Ashish-Soni08

Copy link
Copy Markdown
Contributor Author

Hi @marta-sd, the promised update is on the branch now: commit 8f2d1ca, rebased onto current main. The earlier failures were a fork-sync problem in my tooling, since fixed.

What the branch changes relative to main:

  • fern/versions/latest/pages/reference/cli-commands.mdx: --environment NAME added to the Common Options table, and the tip below it now lists all four name selectors. The per-command --environment rows are upstream docs(cli): fix cli-commands.mdx issues from NVBug 6854088 #4093's, untouched, so nothing is duplicated.
  • fern/versions/latest/pages/get-started/quickstart.mdx: step 2 uses your wording — "run your agent on 5 samples from an example task set to verify everything works".

The installation.mdx --version sample change and the three docs-link tests are fully reverted; the PR no longer touches them. That leaves DOC-849c8f3d (the abridged gym --version sample) outside this PR — I can send it separately if it's still wanted.

The commit carries the DCO sign-off.

@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-customer Waiting on the original author to respond label Oct 10, 2026
@yaoyu-33 yaoyu-33 added the needs-review PR is ready for code review and waiting on a reviewer label Oct 10, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Oct 12, 2026
@yaoyu-33 yaoyu-33 removed the needs-review PR is ready for code review and waiting on a reviewer label Oct 12, 2026
@zyzhou5

zyzhou5 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

/ok to test aa0ac5e

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 12, 2026 21:32
@github-actions

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Oct 13, 2026
@marta-sd
marta-sd enabled auto-merge October 13, 2026 10:01
@marta-sd

Copy link
Copy Markdown
Contributor

/ok to test 68d5475

@marta-sd
marta-sd added this pull request to the merge queue Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

Merged via the queue into NVIDIA-NeMo:main with commit d59d2f9 Oct 13, 2026
30 of 31 checks passed
linj-glitch pushed a commit to linj-glitch/Gym that referenced this pull request Oct 16, 2026
…act when the opening user message fails (NVIDIA-NeMo#4641)

## What does this PR do?

Upstreams NVIDIA-NeMo#3111 to `main`. NVIDIA-NeMo#3111 was merged only into
`super-v3.5-posttraining`.

When the user simulator fails on the opening user message, the
conversational tool-use server now opens the
conversation with the scenario's `reason_for_contact`. Before, it ended
the trajectory before the policy spoke. A
failure here means the simulator raised an error, or its first message
already contained `###STOP###` or
`###TRANSFER###`.

### Cause

In both failure cases the server marked the trajectory invalid or
terminal at turn 0. The agent then returned a
response with an empty `output` list. NeMo RL `main` cannot represent a
sample with no policy tokens. It raises before
any mask is read, so one such row can fail the rollout batch.

### Fix

- When no user message exists yet, the server uses
`customer_scenario.reason_for_contact` as the first user message.
If that is empty or contains `###STOP###` or `###TRANSFER###`, it uses a
generic request
(`DEFAULT_FIRST_USER_MESSAGE`). A `###STOP###`/`###TRANSFER###` message
triggers the fallback only when nothing
precedes it in the conversation; a generation error triggers it whenever
no user message exists yet.
- Each fallback is appended to
`result.source_artifacts.first_user_message_fallbacks`, so each fallback
stays visible
  in the rollout result.
- Failures on later user turns keep the existing invalid/terminal
behavior.
- The new config flag `fallback_first_user_message` controls this. It
defaults to `true`, and the canonical YAML
  declares it. `test_config.py` asserts the canonical value.
- The README configuration table and `docs/rollout.md` document the
flag.

No issue is linked. The cause and fix are recorded in NVIDIA-NeMo#3111, which this
PR ports.

## Validation

Ran on this branch (base `main` at `974d1a921`). NVIDIA-NeMo#3111 cherry-picked
cleanly. Since `super-v3.5-posttraining` split from `main`,
`main` changed these files in 3 commits. The closest is NVIDIA-NeMo#4568 (judge
`text.format`, top-level `mask_sample`). None of them
touch the opening-message path.

- `ng_test
+entrypoint=resources_servers/conversational_tool_use_simulation
+should_validate_data=true`: 85 passed,
  and data validation passed.
- The 3 new fallback tests fail against `main`'s `app.py` and pass on
this branch:
  - `test_first_user_stop_falls_back_to_reason_for_contact`
  - `test_first_user_generation_error_falls_back_to_reason_for_contact`
-
`test_first_user_fallback_uses_default_when_reason_for_contact_is_unusable`

The 3 guard tests pass on both. They cover the flag turned off, for the
stop and error cases, and an error on a
  later turn.
- 3 more tests check that a fallback row is scored and not masked
through `verify()`, that the flag defaults to
`true`, and that a `###STOP###` first message is retried before the
fallback replaces it. Each fails if the behavior
  it covers is broken.
- Parity with `super-v3.5-posttraining`: the fallback code is identical
to that branch at every Gym commit the
training run below used (`e978899b7`, `34b99364`, `14317ecb5`). A local
run of the real agent and resource server
through `verify()` on 23 cases (user simulator, policy and judge
stubbed) matches that branch on reward, mask and
messages with the flag at its default, `true` or `false`. With `false`
it also matches `main` without this PR.
- `pre-commit run --all-files`: passed, no changes.
- DCO: every commit is signed off.

### Rollout evidence

The fix ran in a Nemotron 3.5 Super RLVR training run,
`super35-journey-rlvr-v43-yifuw-001`

([W&B](https://forge.coreweave.com/wandb/nvidia/super-v3p5-posttraining?nw=j0nn1gshftc)).
The run used NeMo RL
`super-v3.5-posttraining`, whose Gym pin has included NVIDIA-NeMo#3111 since
2026-09-04. The run's data blend includes
`conversational_tool_use_simulation`.

- The fallback fired twice. Each time, the user simulator returned only
a reasoning item and no message, so the server
logged `first user message fallback: message_generation_error` (`A
response does not contain a message output`).
Without the fix, each of these rows would have produced an empty agent
output. That branch's NeMo RL also has
RL NVIDIA-NeMo#4001, which turns such rows into masked placeholders, so this run
shows the fallback trains safely rather than
  that it prevented a failure. NeMo RL `main` doesn't have NVIDIA-NeMo#4001.
- Training kept going after both. The first fallback happened during
step 35 of W&B run `dvp5tc0d`, which went on to
step 38. The second happened during step 41 of `0g5thn9y`, which went on
to step 51. The run reached step 78.

## Compatibility

- This changes default behavior. On `main`, a first-turn simulator
failure produces a row with an empty agent output,
labeled `user_failure` and masked. With this PR, that row becomes a
normal conversation that starts from the
scenario's own request, and it is scored and trained on. If the judge
rejects that first message itself, the row is
masked as a user failure, as before. Set `fallback_first_user_message:
false` to restore the old
  behavior.
- Rows whose prefilled history already contains a user message never
fall back.

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

---------

Signed-off-by: Yi-Fu Wu <yifuw@nvidia.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch was previously deployed

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

Labels

area:cli Command-line interfaces and user-facing command behavior community-request Issue reported or requested by someone from the community complexity:low Localized change in one scope with a small, straightforward review surface docs Documentation-only updates or documentation debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[VDR][v0.5.0] Docs stale vs. shipped code

5 participants