Repository navigation
Conversation
ns_tools scores by delegating /verify to math_with_judge and copied only `reward` from the result. When math_with_judge's judge_failsafe masks a judge outage (mask_sample, failure_kind="judge_failed", failure_reason), ns_tools returned an unmasked reward of 0, so the outage was scored as a wrong answer. Carry mask_sample, failure_kind and failure_reason from the delegated result into NSToolsVerifyResponse. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test 9897715 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I found one accepted-input regression and one required validation gap. The delegated fields otherwise match the shared response contract, and the scoring consumers honor the forwarded mask. I inspected both changed files and the affected producer, transport, and aggregation paths. I didn't execute tests or rollouts in this read-only review.
RISK — Record a representative real smoke rollout
The PR explicitly reports no real model rollout. Its injected TestClient A/B exercises the outage branch, but the protected AGENTS.md quality bar requires representative real model smoke rollouts for behavior-changing environment work. This change to verification changes score eligibility, so that requirement applies. The supplied experiment does not establish that the configured agent, tool server, and delegated verifier still work together with real model output. This is an evidence gap, not a demonstrated runtime failure.
Could you run a representative tool-using model rollout through the existing ns_tools pairing, inspect the agent and verifier output, and record the model/configuration, exact commands, completion count, reward, and mask status in the PR? No production-code change or naturally occurring judge outage is needed for this check.
Acceptance and preservation: The real rollout should complete tool use and delegated verification, with a reward consistent with the inspected answer and a valid grade remaining unmasked. Retain the deterministic masked-outage assertions, the successful delegation/default assertions, and exception-path cleanup check. A wrong answer must remain gradable; an unavailable judge must remain masked.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| **body.model_dump(), | ||
| reward=result["reward"], | ||
| # Keep a failure the verifier masked (such as a judge outage) masked: it is not a wrong answer. | ||
| mask_sample=result.get("mask_sample", False), |
There was a problem hiding this comment.
RISK — Accepted request extras now crash response construction.
The request model permits extra fields, so adding mask_sample=False to the existing successful test's request is accepted. If the delegate returns {"reward": 1.0}, body.model_dump() already contains mask_sample; the new explicit keyword then raises TypeError: ... got multiple values for keyword argument 'mask_sample' instead of returning a score. Either diagnostic field independently causes the same collision. These inputs reached a response in the base implementation.
Could you merge the three delegated values into the request dictionary before expanding it? Suggested replacement for the constructor at lines 449–458:
return NSToolsVerifyResponse(
**{
**body.model_dump(),
"mask_sample": result.get("mask_sample", False),
"failure_kind": result.get("failure_kind"),
"failure_reason": result.get("failure_reason"),
},
reward=result["reward"],
delegated_response=result,
**metrics,
)This preserves the invariant that the current delegated result determines these response fields without duplicate constructor keywords. Keep unrelated request extras, the delegated response, timing metrics, and finally-based session cleanup unchanged. The mask must remain independent of the diagnostic fields.
Proposed checks, not executed: Parameterize requests containing each conflicting field separately. With delegated {"reward": 1.0}, each should return reward 1.0, mask False, and both diagnostics None, without raising. With the existing masked judge-failure fixture, each should return mask True, JUDGE_FAILED, and the delegated timeout reason, even when the request contains conflicting values. Also retain an ordinary delegated zero as unmasked, and check that an explicitly unmasked delegated result preserves diagnostic text without becoming masked. Keep the existing success/error cleanup assertions and confirm an unrelated sample extra survives. Please verify the suggested code before adopting it.
…fields The verify request allows extra fields, so a request that already carried mask_sample, failure_kind or failure_reason made NSToolsVerifyResponse raise "got multiple values for keyword argument". Merge the delegated values into the dumped request before expanding it, so the verifier's verdict always wins. Parametrize the delegated-verdict test over each conflicting request field and over scored, masked and unmasked-diagnostic delegated results. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test d9983b8 |
Signed-off-by: yaoyu-33 <[email protected]>
What
ns_toolsscores a rollout by sending/verifyto its delegated verifier (math_with_judgeby default) and buildingNSToolsVerifyResponsefrom the result. It copied onlyreward. It now also carriesmask_sample,failure_kindandfailure_reasonfrom the delegated result. Everything else in the response is unchanged, and a delegated result without these fields still givesmask_sample=False,failure_kind=None.The verify request allows extra fields, so a request can already carry any of these three names. The delegated values are merged into the dumped request before it is expanded, so the verifier's verdict always wins and the constructor never gets the same keyword twice. Other request fields still pass through unchanged.
Why
When the judge call fails,
math_with_judge'sjudge_failsafereturnsreward: 0.0withmask_sample: true,failure_kind: "judge_failed"and the judge error infailure_reason.ns_toolsdropped those three fields, so the outage came back as an unmaskedreward: 0withfailure_kind: None. Downstream metrics then counted a judge outage as a wrong answer. An outage is not a wrong answer: the sample must stay masked so it is left out of scores, as it is whenmath_with_judgeis used directly.No issue: this is a small pre-existing bug found while reviewing #5479, kept out of that PR to keep it focused. #5479 edits the same
verify()return statement, so whichever merges second needs a trivial rebase.Validation
test_verify_takes_verdict_fields_from_delegated_result, 15 cases: 3 delegated results × 5 requests.{"reward": 1.0}; the maskedjudge_failedrow thatjudge_failsafereturns; and an unmasked row that still names a failure (judge_unparseable).mask_sample=True,mask_sample=False,failure_kind, orfailure_reason.reward,mask_sample,failure_kindandfailure_reason, keepdelegated_response, and keep an unrelated request field (question).main, 13 of 15 cases fail. Only the two scored cases whose request agrees with the expected answer pass: the one with no conflicting field and the one carryingmask_sample=False.maindrops the delegated fields, and it returns whatever values the request carried for them. For example, a request carryingmask_sample=Truecomes back masked even though its verdict scored 1.0.TypeError: ... got multiple values for keyword argument.test_verify_delegates_to_math_with_judge(delegated reward 1.0) andtest_verify_uses_default_verifier(delegated reward 0.0) now also assert that an unmasked delegated result staysmask_sample=False,failure_kind=None.pytest resources_servers/ns_tools/tests/in an ns_tools venv withnemo_skills: 40 passed.pre-commit run --files resources_servers/ns_tools/app.py resources_servers/ns_tools/tests/test_app.py: all hooks passed.Rollout evidence
N/A for a model rollout: the change only copies three fields from the verifier's reply, and the path it fixes runs only when the judge call fails, which a model rollout does not exercise on demand. Instead, an A/B through
ns_tools' real/verifyroute (FastAPITestClient, with itsjudge_failsafeand observability wrappers) fed the row that the realnemo_gym.verification.judge.judge_failsafebuilds when a judge call raises:ns_toolsapp.pyrewardmask_samplefailure_kindfailure_reasonjudge_failedjudge request timed outmainjudge_failedjudge request timed outCompatibility
Rows from
ns_toolsruns whose judge failed are now masked instead of scored 0, so reportedns_toolsaccuracy may rise slightly on runs that had judge outages. Runs without judge failures are unaffected.🤖 Generated with Claude Code