Repository navigation
Conversation
…come ladder Each of these adapters decided its own response for the same events: Hermes flipped a context limit to incomplete and left a stale model_context_limit, Stirrup re-raised 401/403/404/429/5xx and transport errors as a 500 that lost the status, BrowseComp wrote ng_agent_outcome by hand and dropped the partial trajectory on a model error, and NOOA answered a sandboxed deadline with a 500 and every transient failure with a bare 503. Each adapter now fills a RunEvidence from its own records and returns finish_response with HTTP 200; launch, supervisor, capture and unreadable artifact failures still raise. - Hermes: the runner's result maps to context limit, wall_time deadline, turn and output limits and the classified error; a runner exception is agent_run_error instead of a 500. - Stirrup: the runner keeps every APIStatusError's status and records a transport error; a runner exception is agent_run_error instead of a 500. - BrowseComp: a model call that fails after Gym's client retries ends the run with the trajectory so far, classified by status or as a transport error; a token-count failure is no longer reported as a model error. - NOOA: a sandboxed deadline returns the worker's partial result as a timeout (a deadline before any reply stays retried); a failed run is agent_run_error or model_transport_error instead of a 500 or 503. A model 4xx other than 408/425/429 before any model reply is now model_request_rejected for all four. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
…-python-host-adapters Signed-off-by: yaoyu-33 <[email protected]>
…opped The ladder now lets a run the session's close cancelled set RunEvidence.stopped (incomplete, stop reason stopped, no ng_rollout_stop). Both runners record that case as stop_reason cancelled, which main reported as incomplete. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
…-python-host-adapters Signed-off-by: yaoyu-33 <[email protected]>
…-python-host-adapters Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
…BrowseComp Scripted-model smokes showed these adapters classifying a context overflow by its HTTP status alone: model_request_rejected (failed, not graded) on the first request and model_request_error 400 after a reply. Gym's model servers answer an overflow they propagate with HTTP 400 and OpenAI's error envelope, code context_length_exceeded, and a context limit is graded as incomplete. Each adapter now classifies a failed model call with model_http_error_outcome(status, error_body=...), reading the endpoint's own error body: - Stirrup: the sandbox runner keeps the OpenAI SDK error's response text as model_error_body next to model_error_status. - NOOA: the run result, the worker's result.json and its checkpoints keep the rejected call's response_content as model_error_body. - BrowseComp: the aiohttp ClientResponseError's response_content. Any other failed request keeps its status, so the outcome of every other 4xx and 5xx is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
…s, Stirrup and NOOA Scripted-model smokes killed each harness before it wrote its output. Hermes and Stirrup raised "sandbox runner exited without output" from artifact capture, and NOOA raised "worker did not exit successfully (exit 137)", so the agent answered HTTP 500 and the rollout's trajectory was dropped. A harness that exits nonzero or leaves no result is a failed run, agent_run_error, which the Environment Server retries by default. When the supervisor's receipt shows the runner ended on its own (a nonzero exit or a kill, not the deadline, no supervisor error, not a command that could not start) and the output file is absent, the adapter now finishes the run through the outcome ladder with no result and returns HTTP 200: - Hermes and Stirrup: artifact capture returns the runner's error in place of raising; Stirrup's response then has no observations. - NOOA: the sandbox runner returns the run with whatever checkpoint or final result the worker left, ended as an infrastructure error. Absence is checked with a probe in the sandbox, because some providers report a missing file as a generic transfer error. These stay typed raises: an output that exists but cannot be read or parsed, a missing output after a clean exit, a supervisor error, a negative or missing cleanup receipt, a provider exec error, and a deadline (a timed-out run is never agent_run_error). Tests that pinned the raise for a killed NOOA worker now assert the returned run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
This was referenced Nov 10, 2026
yaoyu-33
added a commit
to yaoyu-33/Gym
that referenced
this pull request
Nov 15, 2026
Pinned Hermes also ends a run with `partial: true` and "Model used all output tokens on reasoning with none left for the response. ..." when a length stop leaves no visible text, which is the usual shape for a reasoning model cut off mid-reasoning. Classify it as `agent_limit` beside the exhausted-continuation case. Keep every Hermes output-limit error in one `_OUTPUT_LIMIT_ERRORS` set, the name NVIDIA-NeMo#5879 also defines, so its rebase conflicts on one list instead of merging two. Add an episode-level test through `_run_sandbox_episode` that pins the reported `ng_agent_outcome`, and check the attached outcome in the classification test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
katerynaCh
pushed a commit
to katerynaCh/Gym
that referenced
this pull request
Nov 17, 2026
…s output limits (NVIDIA-NeMo#6204) * fix(hermes): classify exhausted continuations as output limits Signed-off-by: yaoyu-33 <[email protected]> * fix(hermes): classify exhausted reasoning budgets as output limits Pinned Hermes also ends a run with `partial: true` and "Model used all output tokens on reasoning with none left for the response. ..." when a length stop leaves no visible text, which is the usual shape for a reasoning model cut off mid-reasoning. Classify it as `agent_limit` beside the exhausted-continuation case. Keep every Hermes output-limit error in one `_OUTPUT_LIMIT_ERRORS` set, the name NVIDIA-NeMo#5879 also defines, so its rebase conflicts on one list instead of merging two. Add an episode-level test through `_run_sandbox_episode` that pins the reported `ng_agent_outcome`, and check the attached outcome in the classification test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> --------- Signed-off-by: yaoyu-33 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…-python-host-adapters Resolve the Stirrup conflicts: keep the ladder's metadata (an optional elapsed_seconds and stop_reason) and add the agent_timeout_sec key and resolve_agent_timeout from the base. The base now carries #5937, whose runner reports stop_reason="max_turns" when Stirrup runs out of turns. Read the turn limit from that stop reason instead of from an incomplete run without one, so such a run stays incomplete (agent_limit) instead of failing as agent_run_error. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
…he merged ladder After merging #5870, finish_response clears error on every graded response, so the Hermes, Stirrup and BrowseComp context-overflow tests now assert that an incomplete context-limit response has no error (Hermes keeps its own text in metadata["hermes_error"]). BrowseComp's session loop built its evidence from the reply's status alone, so the stop reasons #6088 records were lost: a context_full length cut was an output limit, and a run that hit max_steps without an answer was completed. The evidence now reads the loop's stop_reason: context_full is a context limit, max_output_tokens an output limit, and max_steps a turn limit, or, when the run still has an answer, a result marked harness_step_limit_reached. A failed response's error is a ResponseError instead of a plain dict. Also cover Stirrup's missing-output guard, both Hermes truncation errors and NOOA's limit rows (agent_limit vs output_limit). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
Contributor
Author
|
/ok to test 12bfb27 |
yaoyu-33
marked this pull request as ready for review
November 18, 2026 00:39
…e row This PR reports a 4xx before any model reply as model_request_rejected, which the Environment Server fails instead of grading. The episode then ends as a failure row whose failed response is `_ng_failure_partial_response`, so `rollout_token_count_mismatch` found no transcript usage and the Hermes and Stirrup conformance `model_error` scenarios reported it unobserved instead of healthy (P0). Read the partial response when the row has no `response`, as rollout recovery already does. Same change as b9249e3 on #5877 (its health-check part), so the two branches merge cleanly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
Contributor
Author
|
/ok to test 090cab9 |
7 tasks done
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #5870 (the shared outcome ladder). The base is
feat/agent-outcome-ladder, so this diff shows only the four adapters. Merge #5870 first.What changed and why
The same event got a different response in each of these adapters. This PR moves each one onto the ladder: the adapter fills a
RunEvidencefrom its own records and returnsfinish_response(...)with HTTP 200. Launch, supervisor, capture and unreadable-artifact failures still raise.hermes_agent/app.py,sandbox.py)_run_evidencereads the pinned Hermes result:stop_reasonwall_time→ deadline,cancelled→ stopped (the session's close),max_iterations→ turn limit;error/failed→classify_outcome.model_context_limitmetadata are gone.failedagent_run_error(retried by default), and the runner's observations are kept.stirrup_agent/sandbox_runner.py,app.py,sandbox.py)APIStatusErrorwith its status. Before, it re-raised everything except 400/413/422, which produced a 500 that lost the status.APIConnectionErroras a transport error, with the turns completed so far.classify_outcomemaps it tomodel_transport_error.agent_run_errorinstead of a 500.stop_reasoncancelled→ stopped.browsecomp_agent/app.py)model_transport_error.ng_agent_outcome(_model_request_failure), which dropped the partial output, is gone.model_request_error. It ends the loop, and the error receipt is answered 200agent_run_errorinstead of a 500.context_full(a length cut below the output budget, how the model server answers an overflow) → context limit,max_output_tokens→ output limit,max_stepswithout an answer → turn limit. An answer atmax_steps(the last reply's text or the progress board's recovered answer) stays the result, markedharness_step_limit_reached./runpath is unchanged.nooa_agent/app.py,runner.py,sandbox_runner.py,sandbox_entrypoint.py)timeout_exceeded, decided withretry_deadline_before_reply=True. Before, it was aRuntimeError500 and the partial result was lost.agent_run_error, ormodel_transport_errorwhen the model client's own record shows its last call got no reply (newmodel_transport_errorfield, carried through the worker result).HTTPException(503)is gone.failedagent_invalid_output(graded, as before).A model 4xx other than 408/425/429 before any model reply is now
model_request_rejectedfor all four (decision 4).Two later commits close gaps that the scripted-model smokes found:
Context overflow (decision 1). Stirrup, NOOA and BrowseComp classify a failed model call with the shared
model_http_error_outcome, which takes the endpoint's error body:response.text;response_contentthrough its run result,result.jsonand checkpoints;response_content.So a context overflow the model server propagates (HTTP 400, code
context_length_exceeded) is a gradedincompletecontext limit, before or after the first reply. It was failedmodel_request_error400, ormodel_request_rejectedon the first request. Nothing matches on message text. Hermes already read its own "Context length exceeded" result.A harness that leaves no output (decisions 3 and 5). When Hermes', Stirrup's or NOOA's runner is killed or exits nonzero without writing its output, the ladder now answers 200 failed
agent_run_error(retried) and keeps the partial work. Before, it raised a 500 and dropped the trajectory.Tests that pinned main's behaviour are updated, with the reason in a comment or the test name. Per-event tests assert the final status and
ng_agent_outcome.Issue: none; this is part of the step 1 migration that #5870 starts.
Disposition changes
Source of each "main" cell: code reading of main
acb67734cc(the files are unchanged from #5870's base), cross-checked against main's tests named in parentheses.Events: a context overflow (explicit, with vLLM's propagate flag on, or harness-detected) · b deadline before any reply · c deadline after a reply · d no usable result · e persistent 429/5xx · f 401 · g other 4xx before any reply · h refusal. ★ marks a row whose action changes.
ng_agent_outcome→ actionmodel_context_limit→ verify (test_context_limit_keeps_partial_work_verifiable)test_runner_stopped_at_the_deadline_is_a_partial_response)test_close_preserves_runtime_gap_after_runner_error)agent_run_error→ retrymodel_request_error429/5xx → retry (test_provider_failure_is_reported_and_replays_without_rerunning)model_request_error401 → failmodel_request_rejected, after it 401 → failmodel_request_error400 → verifymodel_request_rejected→ failmodel_request_error400 → verify (test_a_request_the_model_server_rejects_ends_the_run_as_failed_with_the_turns_so_far); on the first request it would bemodel_request_rejectedtest_a_supervisor_timeout_with_the_runners_wall_time_report_is_an_incomplete_response)test_a_failed_run_still_reports_what_it_observed)agent_run_error→ retrymodel_request_errorstatus /model_transport_error→ retrytest_a_model_server_error_that_is_not_a_rejected_request_still_fails_the_run)model_request_error→ verifymodel_request_rejected→ failmodel_request_rejected→ failmodel_request_error400, output dropped → verify (test_a_model_http_error_is_a_failed_response_for_the_outcome_policy)test_the_sandbox_activation_clamps_its_deadline_and_fails_on_an_error_receipt)agent_run_error→ retrymodel_request_error→ retry; transport: 500 → retrymodel_transport_error→ retrymodel_request_error→ verifymodel_request_rejected→ failmodel_request_error400 → verify / 404 → failagent_run_error→ retrymodel_request_error400 → verify (test_model_rejection_obeys_environment_policy_and_closes)test_worker_deadline_preserves_checkpoint_without_retryable_dependency_error)unknown→ retrytest_failed_activation_replays_error_and_returns_evidence_on_close)agent_run_error/model_transport_error→ retrymodel_request_error429/5xx → retrymodel_request_error→ verifymodel_request_rejected→ failagent_invalid_output→ verifyScores change for:
incomplete); without the context-limit rule, decision 4 would have failed it.agent_run_errorwith the partial work, not a 500.Other changes keep the action (500/503 → 200 with the same retry), or change only the status (incomplete ↔ failed, both graded).
Gaps left for step 5 (deadlines)
agent_timeout_sec(set by the harbor Environment Server), not from the task row'sagent_timeout_secmetadata that Hermes, Stirrup and NOOA read throughresolve_agent_timeout.No budget is invented here.
Not changed
_create_response, used by the host/run) keeps its old status logic; step 7 removes it.agent_run_error, not a timeout.max_retries=2, so 3 attempts, which include 409). Gym'sDynamicMaxTokensChatCompletionsClient.generateoverrides Stirrup'sgeneratewithout its tenacity@retry.error.Validation
Run on macOS against the worktree, with each adapter's pinned dependencies (stirrup 0.1.12, hermes-agent 26bb847a, nooa 19caab16) on the path:
hermes_agent/tests: 374 passed, 6 skipped, 1 failed. The failure istest_seed_import_check_ignores_task_hermes_home, which needs the sandbox's Hermes runtime and also fails on the base.stirrup_agent/tests: 166 passed, 20 failed.timeout.test_sessions.pyand the shell tests intest_sandbox_runner.pydid not run here. That includes the updatedtest_a_failed_episode_still_closes_with_its_evidence.browsecomp_agent/tests: 151 passed.nooa_agent/tests: 758 passed, 10 skipped (Linux installer tests).1ab389db79,3771af49ad), run on a Linux host in each adapter's locked venv against the merge commit before them. Every test passed on both sides, including the Linux supervisor tests that fail on macOS:pre-commit run --files <touched>: passed.Smoke evidence
All runs are scripted-model smokes on a Linux host, with no real model. Gym's real
vllm_model(propagate_context_overflow_errors: true) sits in front of a scripted upstream, and the action is the Environment Server's under the default policy.main's adapters.be8ff67e8f.3771af49ad, rerun for the rows the fixes changed.Hermes, Stirrup and NOOA: harness conformance scenarios.
model_error(400 before a reply)model_request_error400 → verify ⇒model_request_rejected→ failcontext_overflowmodel_context_limit→ verify; B: incomplete → verifymodel_request_error400 → verify; B′: incomplete → verifycontext_overflow_lengthagent_limit→ verify; B: incomplete → verifydeadline_before_replyunknown→ retry (transitional rule)deadline_after_replyharness_no_resultagent_run_error→ retrymodel_401model_request_error401 → fail ⇒model_request_rejected→ failmodel_request_rejected→ failmodel_503model_request_error503 → retry, unchangedmodel_request_error503 → retryDisposition changes A → B′: Hermes 1, Stirrup 2, NOOA 2. In B′, every rerun cell passes its P0 checks except Stirrup's
harness_no_result. There the outcome is right (200 failedagent_run_error, retried), but the failure row has no invocation and no turns. Stirrup's runner reports its observations only inoutput.json, which a killed run never writes. That gap was already there on A, hidden behind the 500. It is trajectory capture, not the ladder, and it is left for a follow-up.BrowseComp (not in the conformance registry): a driver over the session routes, with the Docker sandbox provider.
model_request_error400 → verifymodel_request_rejected→ failmodel_request_error400, 0 output items → verifymodel_request_error401 → failmodel_request_rejected→ failmodel_request_error503 → retrymodel_request_error400 → verifymodel_request_rejected→ failmodel_request_error400 → verifyagent_run_error→ retryCounts over these 10 events: A verify 6, retry 3, fail 1. B′ verify 5, retry 3, fail 2.
Decision 6 (harness retries), found by the smokes and not changed here:
gym_llmretries only 429.A graded response (completed or incomplete) carries no
error: #5870'sfinish_responseclears it, so a context-limit response no longer keeps the model call's error. Hermes keeps its own text inmetadata["hermes_error"].Merge with #5870 (
12bfb2745b)#5870's head (
94d20acf69, which carries main up to #6160) is merged in. What changed here:Stirrup turn limit. The base now has fix(stirrup): report a run that exhausts its turns as stop_reason max_turns #5937: the runner reports
stop_reason="max_turns"when Stirrup runs out of turns._run_evidencereads the turn limit from that stop reason (it looked for an incomplete run without one), so such a run staysincompleteagent_limitinstead of failing asagent_run_error. Conflict resolution also keeps the base'sagent_timeout_sececho.BrowseComp stop reasons (feat(browsecomp): port RL caching, stop reasons, and lifecycle logs #6088): mapped as described above.
Tests. The context-overflow tests now assert
error is None. New: BrowseComp session rows for each loop end and for a 400 after an empty-answer retry; Stirrup's missing-output guard; both Hermes truncation errors; NOOA'sagent_limitvsoutput_limitrows. The new BrowseComp rows fail on the code before the fix.Health check (
090cab9d00,nemo_gym/rollouts/health/checks.py). A 400 before any reply is now a failure row, sorollout_token_count_mismatchreads usage from_ng_failure_partial_responsewhen the row has noresponse. Without it, CI's Hermes and Stirrup conformancemodel_errorscenario reported the known zero usage as unobserved (P0). Same change as refactor(agent): move Claude Code, Codex and OpenCode to the outcome ladder #5877's b9249e3.Known base failure:
tests/unit_tests/test_moved_paths.py::test_every_recorded_name_still_resolves_at_its_old_path(nemo_gym.harness_capabilities.behavior.MODEL_REQUEST_ERROR) fails on #5870's head too; theMOVED_NAMESentry belongs in #5870.Validation at
12bfb2745b, Linux host, each adapter's locked venv: Hermes 426 passed, Stirrup 218 passed, NOOA 790 passed, BrowseComp 174 passed.pre-commit run --files <touched>passed.Stirrup conformance smoke at the merge commit (scripted model, no real model, Linux, local sandbox provider):
tool_successverifier_failuredeadline_after_replytimeout(wall_time)context_overflowcontext_limitmodel_503model_request_error503harness_no_result(killed runner)agent_run_errormodel_error(400),model_401model_request_rejectedEvery scenario passes its P0 checks except the known
harness_no_resulttrajectory gap described above.🤖 Generated with Claude Code