Repository navigation
fix(health): don't flag a bad-path grep when other searches in the rollout ran - #6622
Conversation
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]>
|
@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. |
…ed-bad-path Signed-off-by: Dundy Pasupuleti <[email protected]>
|
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) |
|
/ok to test 3c51d06 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
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.
| if opening.startswith(marker): | ||
| if call.get("status") != "completed": | ||
| marked[marker] = marked.get(marker, 0) + 1 | ||
| elif opening: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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
left a comment
There was a problem hiding this comment.
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.
|
/review e6feaaa |
This comment has been minimized.
This comment has been minimized.
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
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.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/46730719397 |
What does this PR do?
Closes #6374.
OpenCode returns
ripgrep execution failedfrom itsgrepandglobtools both when ripgrep cannot run and when the call'spathdoes not exist.rollout_tool_call_failedcounted 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_failednow counts a markedgrep/globoutput only when nogrep/globcall 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 samecount. Calls with no output, blank output, an output shape the check cannot read, or a marker on acompletedcall 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
test_a_marked_search_next_to_a_search_that_ran_is_not_a_tool_failure: a lone bad-pathgrepis still one finding; next to agreporglobthat returned results it is no finding.test_a_search_with_no_output_or_another_tool_does_not_show_the_search_tool_runs: empty, blank or unreadablegrepoutputs, abashcall with output, and acompletedmarked call do not hide three marked failures (countstays 3).test_tool_outputs_that_report_the_harness_tool_could_not_run_are_one_counted_finding: the non-marker sibling outputs moved tobashso 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_identicaland the threetest_raw_responses_stream_capture_preserves_response_populationcases) also fail on unmodifiedmainin my environment, so they are unrelated.ruff checkandruff format --checkon 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/globcalls 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_failedfindings, so--max-unhealthy-fractiongates stop failing on them.Checklist
pre-commit run --all-files) (so CI lint/format checks pass). (ruff check and ruff format on the changed files)git commit -s) (so the DCO check passes).