Skip to content

fix(health): don't flag a bad-path grep when other searches in the rollout ran - #6622

Merged
ffrujeri merged 3 commits into
NVIDIA-NeMo:mainfrom
dundysm:fix/health-tool-call-failed-bad-path
Dec 1, 2026
Merged

ffrujeri merged 3 commits into
NVIDIA-NeMo:mainfrom
dundysm:fix/health-tool-call-failed-bad-path

Conversation

@dundysm

@dundysm dundysm commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Closes #6374.

OpenCode returns ripgrep execution failed from its grep and glob tools both when ripgrep cannot run and when the call's path does not exist. rollout_tool_call_failed counted every such output, so a single made-up path marked the whole rollout unhealthy, even when other searches in the same rollout returned matches.

_rollout_tool_call_failed now counts a marked grep/glob output only when no grep/glob call in the same trajectory returned a non-empty output without the marker. A sandbox without ripgrep (#6194) still fails every search and is still flagged with the same count. Calls with no output, blank output, an output shape the check cannot read, or a marker on a completed call do not count as evidence that the tool runs. The rule is kept per marker, so a future marker for other tools is judged against its own tools only.

The rollout-health doc table entry for the check is updated to match.

Validation

  • New test_a_marked_search_next_to_a_search_that_ran_is_not_a_tool_failure: a lone bad-path grep is still one finding; next to a grep or glob that returned results it is no finding.
  • New test_a_search_with_no_output_or_another_tool_does_not_show_the_search_tool_runs: empty, blank or unreadable grep outputs, a bash call with output, and a completed marked call do not hide three marked failures (count stays 3).
  • test_tool_outputs_that_report_the_harness_tool_could_not_run_are_one_counted_finding: the non-marker sibling outputs moved to bash so it still checks the 129 count; existing completed/bash cases unchanged.
  • pytest tests/unit_tests/rollouts/test_rollout_health.py: 390 passed, 4 failed; the same 4 (test_health_on_and_off_leave_collection_and_metrics_byte_identical and the three test_raw_responses_stream_capture_preserves_response_population cases) also fail on unmodified main in my environment, so they are unrelated.
  • ruff check and ruff format --check on the changed files: passed.

Rollouts

N/A: this changes only which rollouts the health check labels; rewards, retries and gate logic are unchanged. On the DeepSWE run described in the issue, the 3 unhealthy rollouts each had working grep/glob calls next to the bad-path one, so they would no longer be flagged.

Compatibility and benchmark impact

None for scores. Runs with OpenCode searches on nonexistent paths report fewer rollout_tool_call_failed findings, so --max-unhealthy-fraction gates stop failing on them.

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). (ruff check and ruff format on the changed files)
  • New source files include the required Apache-2.0 SPDX header. (N/A: no new files)
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

OpenCode returns 'ripgrep execution failed' both when ripgrep cannot
run and when a grep or glob names a path that does not exist. The
rollout_tool_call_failed check counted every such output, so one made
up path marked the whole rollout unhealthy.

Count a marked grep/glob output only when no grep/glob call in the same
rollout returned a non-empty output without the marker. A sandbox
without ripgrep still fails every search and is still flagged.

Signed-off-by: Dundy Pasupuleti <[email protected]>
@copy-pr-bot

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

@dundysm

dundysm commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

@AdamRajfer could you take a look when you get a chance? this narrows the rollout_tool_call_failed check from #5600 so a bad-path grep next to working searches is no longer flagged; @wprazuch this follows the fix proposed in #6374. ci will need an /ok to test.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Nov 22, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added risk:low Autobot PR risk: low bug Something isn't working area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters needs-review PR is ready for code review and waiting on a reviewer labels Nov 22, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 23, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Nov 24, 2026
@dundysm

dundysm commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

merged main to clear the conflict in rollout-health.mdx (main added the rollout_scored_despite_failure row next to rollout_tool_call_failed; both kept, checks.py and tests merged cleanly). tests/unit_tests/rollouts/test_rollout_health.py passes (402 passed)

@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Dec 1, 2026
@wprazuch

wprazuch commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

/ok to test 3c51d06

@wprazuch

wprazuch commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

/review

@nemo-pr-automation
nemo-pr-automation Bot requested review from a team December 1, 2026 13:41
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

SHIP WITH CARE

I found one RISK: a failed or cancelled search can suppress genuine missing-ripgrep evidence even when no search succeeded. No BLOCKER findings.

I reviewed all three changed files, the OpenCode trajectory producers, and downstream health reporting and threshold handling, with two delegated reviewers.

Validation: I ran base/head CPU probes through run_health_checks and OpenCode’s outcome converter in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, the default-branch CI image selected because this head had no successful container build. The probes confirmed the intended bad-path suppression, output-shape guards and rollout isolation, and reproduced the false negative below. Contract probes also checked that saved rollout bytes and rewards stayed unchanged. I did not rerun the CI suites or launch real model rollouts.

On the reviewed head, CI’s four core-test shards, eight server-suite shards, Unit tests / Test and Nemo_CICD_Test passed. The non-blocking OpenCode and miniswe_sandboxed conformance jobs failed, along with their publication/aggregate checks. I have not attributed those failures to this change.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

Comment thread nemo_gym/rollouts/health/checks.py Outdated
if opening.startswith(marker):
if call.get("status") != "completed":
marked[marker] = marked.get(marker, 0) + 1
elif opening:

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.

RISK: failed searches count as proof that ripgrep works. Could this branch require affirmative execution success before adding the marker to worked? Any nonblank non-marker output currently qualifies, including error text. OpenCode’s outcome converter puts state.error into output while retaining failed or cancelled status.

I reproduced this through the public health runner: a failed grep reporting ripgrep execution failed: spawn rg ENOENT, followed by a cancelled grep reporting only Tool execution aborted, produces healthy with no findings on head. Base reports rollout_tool_call_failed, count 1. No search succeeded. This hides broken-search rollouts and can lower the unhealthy fraction consumed by the configured health criterion.

The smallest correction is to require status == "completed" alongside the existing nonblank/non-marker condition, or another explicitly supported affirmative-success signal. Keep unsuccessful error text from clearing marked failures while preserving suppression by successful grep/glob results.

Acceptance: add public-runner cases combining a marked failure with a failed non-marker error and with a cancelled search, in both orders. Each must retain count 1 and an unhealthy verdict; completed successful grep/glob cases must still suppress it. Reproduction: PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=/workspace/review/source python /workspace/review-probes/health-logic-1/probe.py /workspace/review-probes/health-logic-1/head.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agreed, fixed in e6feaaa: a grep or glob call now counts as proof that ripgrep runs only when its status is completed, so failed or cancelled error text no longer clears a marked failure. added a parametrized public runner test (marked failure plus a failed search, a cancelled Tool execution aborted search, or a status less glob, each in both orders) that keeps count 1; the existing completed grep/glob cases still suppress it. i exercised the check function directly with those cases; the full suite needs omegaconf, which this env lacks, so i did not run pytest here.

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Dec 1, 2026
OpenCode keeps the error text of a failed or cancelled tool call as its
output, so a nonblank output alone could clear a marked ripgrep failure
when no search succeeded. Require status completed before a grep or glob
call suppresses the marker, and cover failed, cancelled and status-less
calls in both orders.

Signed-off-by: Dundy Pasupuleti <[email protected]>

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

Thanks. Only a completed search with output now shows that the search tool runs, so a failed or cancelled call can no longer hide a real ripgrep failure, which was the bot's finding. The tests cover both orders and the no-status case. LGTM once CI passes on this head.

@ffrujeri
ffrujeri enabled auto-merge December 1, 2026 18:08
@ffrujeri

ffrujeri commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

/review e6feaaa

@svcnvidia-nemo-ci

This comment has been minimized.

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

SHIP

The prior RISK in review:6132844116 and comment:4755338473 is fixed. The success condition now requires status == "completed", so failed or cancelled search output cannot clear a genuine ripgrep failure. Completed grep/glob results still suppress the intended bad-path finding.

I compared against the reachable previous-review commit 3c51d066ff6832da145eea6ada55e756a9b0962f, reviewed the intervening implementation and tests, and collected two delegated reviews covering producer semantics and downstream health reporting. No new findings meet this follow-up’s strictly-above-moderate impact threshold.

Validation: I ran a 38-case previous/head differential probe through run_health_checks and OpenCode’s outcome converter using /workspace/review-probes/follow-up-leader/probe_status.py. Both runs passed their revision-specific assertions. Failed, cancelled and incomplete sibling searches changed from count 0/healthy on the previous revision to count 1/unhealthy on this head; completed searches still suppressed the marker. Delegated probes also checked output shapes, rollout isolation, report counts and unhealthy-fraction handling. Saved rollout bytes stayed unchanged.

All probes used 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, the default-branch CI image selected because this head had no successful container build. I did not rerun repository suites or lint, or launch real model rollouts.

CI was not fully green at my last read: core-test shard 2, server-suite shard 2 and LongMT scoring tests passed; the other core/server shards were still running. The non-blocking OpenCode and OpenClaw conformance jobs failed. OpenCode’s log showed two plugin-initialization test failures before the validation step timed out. I have not attributed those CI failures to this change, and pending or skipped checks are not counted as passes.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

@ffrujeri
ffrujeri added this pull request to the merge queue Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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

Merged via the queue into NVIDIA-NeMo:main with commit c2974f7 Dec 1, 2026
76 of 81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters bug Something isn't working community-request Issue reported or requested by someone from the community needs-review PR is ready for code review and waiting on a reviewer risk:low Autobot PR risk: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

health: rollout_tool_call_failed counts an OpenCode grep/glob on a missing path as a harness failure

4 participants