Repository navigation
fix(hermes): retain session evidence and report provider errors - #4742
giuliolovisotto merged 7 commits into
Conversation
|
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. |
e587b65 to
789c8b0
Compare
yaoyu-33
left a comment
There was a problem hiding this comment.
Thanks for the Hermes fix. The token-counter backfill and header injection check out against the pinned Hermes revision (414 passed, 8 skipped locally). Main points: on the session path provider failures now reach the verifier unmasked, a regression from legacy /run, plus a stale README line. Optional: a transport timeout on the session path still raises 500 (please say whether that's intended), and the token-counter backfill is duplicated between host and sandbox runner.
Review context: these five PRs (#4782 contract; #4739 Pi, #4740 Codex, #4741 OpenCode, #4742 Hermes) are a split of one change. This PR's diff vs main also contains #4782's conformance files, so please retarget/rebase once #4782 merges. Note that harness_conformance runs all four probes for any shared-file change, so model_error should fail for every harness until its fix lands; if that check is required, #4782 and the siblings need to land together.
PR hygiene: the validation commands and live-smoke artifacts reference an author-local path, and current-head CI isn't in the evidence (the combined 28/28 run is for 118f1de37). Could you attach the exact commands and the CI run for this head?
Generated by Claude Code
| model_name=self._model_name(), | ||
| n_input=len(params["history"]) + 1, | ||
| # Report the failed model exchange to the EnvironmentServer; it owns grading policy. | ||
| retain_provider_failure=True, |
There was a problem hiding this comment.
This now returns provider errors (401/403/429/5xx included) on the sandbox session path as a failed response that goes on to /verify, which matches the #4782 contract. But I couldn't find anything on the environment-server side that masks it: single_agent_turn forwards the response unconditionally and mask_sample is only set by individual verifiers. Before this change the legacy /run path masked these via provider_failed (app.py:1103); nothing on the session path reads that metadata, so this is a regression from the masked behavior, so a transient provider error can now become an unmasked reward-0 sample. Could you point to where that is masked, or land the masking/retry policy first (or limit this to model-caused statuses, as Hermes does for 400/413/422)? The comment at app.py:84-86 ("stay provider failures and are masked") is also stale for sessions, and test_sandbox.py:273 could assert provider_failed vs model_rejected metadata per status.
There was a problem hiding this comment.
The inherited #4834 policy now excludes provider execution failures before verification and controls retries, although the legacy masking comment still needs its scope clarified.
There was a problem hiding this comment.
Done—the comment now limits masking to legacy /run, while agent sessions use #4834’s configurable verification/retry/failure policy before verification.
| response = self._response_from_result( | ||
| body=body, | ||
| result=result, | ||
| model_name=self._model_name(), |
There was a problem hiding this comment.
Docs: README.md:166
This line still says sandbox sessions "retain their existing retryable failure path", but a recognized terminal provider error now returns a failed response that can reach verification. Could you update it to describe that, and that execution/cleanup failures still raise?
There was a problem hiding this comment.
Done—the README distinguishes classified session responses governed by the Environment Server from worker and cleanup failures that remain execution errors.
| if match and 400 <= int(match[1]) <= 599: | ||
| return AgentOutcome(failure_kind=MODEL_REQUEST_ERROR, status_code=int(match[1])) | ||
| if error in {"Connection error.", "Connection error", "All connection attempts failed"}: | ||
| if error in { |
There was a problem hiding this comment.
maybe something like if any(error.startswith(x) for x in ('Connection error' , ...))
There was a problem hiding this comment.
Done in 128f5fe58: the classifier uses startswith for the three known transport-error prefixes. Regression cases cover appended diagnostic details and an unrelated message that must remain unknown.
Signed-off-by: Giulio Lovisotto <[email protected]>
Signed-off-by: Giulio Lovisotto <[email protected]>
Signed-off-by: Giulio Lovisotto <[email protected]>
Signed-off-by: Giulio Lovisotto <[email protected]>
Signed-off-by: Giulio Lovisotto <[email protected]>
Signed-off-by: Giulio Lovisotto <[email protected]>
128f5fe to
7e870d2
Compare
Signed-off-by: Giulio Lovisotto <[email protected]>
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39782168972 |
Review follow-up on 128f5fe (2026-10-22)
Match known transport-error prefixes even when the message appends diagnostic details; keep unrelated messages unknown. Clarify that the masking comment describes legacy /run, while agent sessions defer routing to the Environment Server.
Validation: 174 Hermes session tests passed, 2 skipped; scoped pre-commit passed. Default routing is unchanged.
Follow-up on 12ce961 (2026-10-22)
170 Hermes session tests passed, 2 skipped; scoped pre-commit passed. Explicit “Context length exceeded” reports use
model_context_limit; generic HTTP 400/413 retainsmodel_request_error. Agent limits and context limits can be configured independently.Rebase validation before the label/formatter follow-up: the combined tip
e5240e16epassed 28/28 Linux conformance scenarios, seven per harness. The policy-only heada928f859epassed 4/7 Hermes scenarios; the dependent stack fixes its evidence gaps. Both returned seven Hermes rollout records with no episode-failure rows; these scenarios do not establish exhausted-provider retry counts. These results are pinned to those revisions, not a claim of fresh CI or a new live-model run on the latest heads.Restore Hermes agent-session evidence and classify native failures for the shared Environment Server policy. Send invocation correlation headers from the sandbox observer, retain runtime token counters on early returns, and isolate observation failures from execution.
Recognize Hermes 26bb847a's
Error code: NNN/HTTP NNNerrors andRequest timed out.. Distinguish explicitmax_iterations, context and output limits from complete-but-invalid output so benchmark policy overrides receive the correct cause.This follows the session migration in #4489; no separate issue is needed.
Stack: #4834 (policy) → #4742 (Hermes) → #4739 (Pi) → #4741 (OpenCode) → #4740 (Codex), registered as GitHub stack #4899. These changes must land together. Do not merge #4834 alone: the Hermes and Codex classifier fixes are in #4742 and #4740.
Validation on 04498f0
Error code: 422text.inference-api.nvidia.com: reward 1, three captured model calls, two tools, verification completed. Linux local sandbox exercised; remote sandbox providers and Slurm were not exercised.Historical CI for c998df7b6; see individual job outcomes rather than treating prior combined runs as current-head CI.
Serial-stack validation (2026-10-21)
Fresh Linux conformance on combined stack tip
fb92b1231: 28/28, including hermes 7/7; this combined result supplements rather than replaces each branch's own unit tests.Portable live-model smoke reproduction for the combined stack is available here; the latest follow-up is limited to agent sessions, with legacy execution explicitly outside scope.
Fresh CI on combined stack tip
d0b6b950a: this harness passed 7/7 (download its report/tests/logs); all four stack harnesses passed, while the separate Kilocodemodel_errorfailure keeps the non-blocking aggregate red (full CI summary).