Repository navigation
Conversation
Today the same event gets a different outcome in different harness adapters: a context limit is graded in one and failed in another, "no usable result" answers 500, 502, 503 or 200, and a model 4xx before any reply is graded, retried or failed depending on the harness. Add one ladder in nemo_gym/agents/agent_outcome.py. An adapter fills a RunEvidence from its own parser and returns finish_response(response, evidence); decide_outcome picks the first matching row (stopped, context limit, deadline with a recorded infrastructure fault, deadline, error, limit, refusal, result, no result). A model 4xx other than 408/425/429 before any model reply becomes model_request_rejected for every harness. No adapter uses it yet. Policy defaults: model_context_limit verifies (backstop for adapters that still report a context limit as failed), agent_run_error retries (no usable result, same disposition as today's 5xx), model_request_rejected fails. Harbor's failed-response routing now shares single_agent_turn's checks (agent_response_action): a failure_report that contradicts ng_agent_outcome fails the episode, and the selected failure is the episode failure's cause and kind. The conformance model_error check expects model_request_rejected, and the harness guide documents the ladder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
A run the session's close cancelled is stopped too, and the ladder reports it as incomplete, but the marker exists to tell a rollout stop apart from a timeout or a cancellation. finish_response now writes it only when the run's session expired (a rollout stop), and documents stopped as covering both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
…aw tests Codex tests imported agent_outcome_policy through single_agent_turn.app, which no longer imports it now that agent_response_action holds the routing; they use the agents package's public API. OpenClaw's context-limit test pinned the old FAIL default for a failed model_context_limit; the ladder's backstop grades it, and an override can still fail it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
…rror_outcome Scripted-model smokes of the migrated adapters showed a context overflow graded differently by harness. Gym's model servers answer a context overflow they propagate with HTTP 400 and OpenAI's error envelope, code `context_length_exceeded`. Adapters that read only the status reported it as `model_request_error` 400 (failed) or, before the first reply, `model_request_rejected` (never graded), against decision 1. `model_http_error_outcome(status, error_body=...)` classifies a failed model request for `RunEvidence.error`: a 400 whose body carries that code is `model_context_limit`, which the ladder answers as `incomplete` before or after the first reply; any other failure stays `model_request_error` with its status. The harness guide points adapters at it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test bb2e2fc |
Signed-off-by: yaoyu-33 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test 94d20ac |
|
/ok to test d7c1af1 |
@yaoyu-33, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I inspected all 26 changed files and their directly affected contracts. This was a static review; I did not execute tests or verify the author's local test artifacts.
RISK: Representative real-model smoke evidence is missing
The PR description explicitly says real-model smoke has not run on this head. This changes grading eligibility through the shared policy defaults and DeepAgents termination handling. Deterministic regression tests do not satisfy the required representative model-and-verifier smoke validation.
Could you run the planned smoke cases on this head and attach the resolved configuration, runtime versions, rollout identifiers and inspected agent/verifier artifacts? Acceptance should show:
- An OpenClaw context-overflow episode through
single_agent_turnreaches verification with its partial output rather than failing ungraded. - A Harbor failed turn with a matching selected transport failure skips verification, stays retryable and keeps the selected event as its cause.
- A task command that terminates DeepAgents returns
incomplete, clearserror, carries no failed outcome and proceeds to verification. Genuine provider failures and unconfirmed cleanup must still stay ungraded.
Keep the deterministic rejection, timeout and cleanup regression coverage; these smoke runs supplement it rather than replace it.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| boundary=FailureBoundary.AGENT, | ||
| failure_kind=outcome.failure_kind, | ||
| http_status=outcome.status_code, | ||
| operation="agent.run", |
There was a problem hiding this comment.
RISK: Reclassified policy timeouts lose the evidence required for routing
finish_response can turn a confirmed model timeout into a terminal consistency failure. Start with the existing _confirmed_policy_timeout() fixture, select its model event, and finish the response with RunEvidence(has_result=False, timed_out=False, model_replied=True, error=AgentOutcome(failure_kind="model_policy_response_timeout")). The new event gets operation="agent.run" and no operation_id. reported_agent_failure therefore rejects it, and agent_response_action returns FAIL even with a model_policy_response_timeout: verify override or a timeout callback that would retry. This affects adapters using the new helper to classify a raw model failure report.
Could you preserve the policy-timeout operation contract when the selected model event proves that timeout? Do not relax the consumer to accept arbitrary agent.run timeout claims. At this constructor, the following is a suggested replacement, not executed; verify it before adopting. It also needs imports for MODEL_POLICY_RESPONSE_TIMEOUT, POLICY_TIMEOUT_OPERATION and confirmed_policy_response_timeout from their defining modules:
confirmed_timeout = (
outcome.failure_kind == MODEL_POLICY_RESPONSE_TIMEOUT
and confirmed_policy_response_timeout(report)
)
event = FailureEvent(
boundary=FailureBoundary.AGENT,
failure_kind=outcome.failure_kind,
http_status=outcome.status_code,
operation=POLICY_TIMEOUT_OPERATION if confirmed_timeout else "agent.run",
operation_id=selected.operation_id if confirmed_timeout else None,
failure_reason=_FAILED_RUN_MESSAGES[decision.stop_reason],
cause_id=report.failure_id,
)This keeps the existing confirmation guard: only a selected model operation whose attempts all timed out after upload gains the correlated policy-timeout event. Other reclassifications still use agent.run, and unproven timeouts still fail consistency checks.
Proposed acceptance: add the setup above to the response regression tests. Assert that a verify override is honored, a supplied retry callback is invoked, and the rebuilt cause retains the model event. Finishing twice must not add another event. Retain the existing direct agent.policy_request callback case and generic reclassification/idempotence assertions. Missing-upload or mixed-attempt timeout reports must still return FAIL without invoking the callback.
…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]>
What and why
Harnesses currently assign different scoring and retry behavior to the same context overflow, rejected request, or missing result. This adds one outcome ladder: adapters supply
RunEvidence,decide_outcomechooses the response, andfinish_responseapplies it. Adapter migrations follow in #5875, #5877, #5879, #5880, #5907 and #5873. No separate public issue is needed: this is the shared first step of that cross-harness consistency effort.ng_rollout_stopretry_deadline_before_replyflag preserves existing retries until model-call session correlation is completemodel_request_rejectedagent_run_errorA final answer at the harness step limit uses
has_resultplusHARNESS_STEP_LIMIT_METADATA_KEY. Recovered faults do not qualify as deadline infrastructure evidence. The HTTP classifier shares the model client's context-overflow parser, including wrapped error envelopes, and safely handles unexpected statuses and deeply nested bodies.finish_responseclears staleerroron graded responses and staleincomplete_detailson completed/failed responses. When the ladder reclassifies a selected failure, it preserves the original event as the cause of anagent.runevent. Anunknownoutcome clears the selection instead, retaining all diagnostic events becauseunknownis not a canonical failure-event kind.Harbor and single_agent_turn share
agent_response_action. A matching selected report becomes the episode failure's cause; mismatches, unreadable selections, omitted reports and null reports fail. No report or an unselected report keeps the outcome policy. A status-less selected model-request error fails unless every attempt is proven never to have connected. The merge preserves #6013's connection-timeout handling and #5686's queue-timeout policy.Compatibility and score impact
model_context_limit: verify,agent_run_error: retry, andmodel_request_rejected: fail. OpenClaw's failed context overflow is now graded. Agentic-MME already overrides context limits to verify in its shipped YAML; default-only configurations now receive the same handling.agent_run_errordefault. Its sandbox observation still reports the failed execution. This is the targeted adapter behavior change in this PR.model_request_rejectedhas no status, so overrides such asby_status_code: {404: retry}no longer match that outcome after migration. Useby_failure_kind: {model_request_rejected: retry}. The original status remains in the cause event when a report supplied it.model_request_errorduring migration; test(conformance): add outcome-ladder scenarios #5873 owns removing that allowance. Wrong/missing/invalid statuses still fail the check.by_failure_kind: {agent_run_error: verify}. The default deadline flip remains deferred until session-correlated model-call capture is available for all harnesses.Related policy work: #5723, #5798, #5686 and #5032. This branch merges main with a merge commit, preserving shared history; no rebase or force push.
Validation
Linux workstation, Python 3.13.14, merged main's OpenAI 2.45.0. Full suites below ran on repair commit
d7c1af12fb42cde125caf953d6d17f16ce9788fe. A concurrent merge advanced the published head to94d20acf69ef5dff3c0c3616d77e1c0e09c9a7dd, adding only main's UI-generation environment; every repair file is unchanged. On that actual head, 178 focused tests and all-files pre-commit passed again, and CI is running.pytest tests/unit_tests/agents tests/unit_tests/core tests/unit_tests/client/test_openai_client.py tests/unit_tests/rollouts/harness_capabilities scripts/harness_conformance/tests environment_servers/single_agent_turn/tests environment_servers/harbor/tests: 3,034 passed, 14 skipped.RecursionErrorthere and passes after repair.--continue-on-collection-errors: 6,555 passed, 72 skipped, 84 failed, 102 collection errors. All 84 executed failures reproduce on unchanged main with verified, isolated source imports; they are outside this repair. 96 collection errors also reproduce on isolated main; the other six collect after the missing image dependencies were installed. Agentic-MME was rerun successfully. Optional SDK/dependency limitations remain.pre-commit run --files <all 26 PR paths>andpre-commit run --all-files: passed, including import-linter. DCO sign-off on both new commits.npm run check/fern check --warnings: zero errors; one warning that authenticated redirect checking was skipped without a Fern token. No page paths or redirects changed./home/yuya/Projects/pr-flow/runs/20261117-011726-pr5870-fix/, including per-finding dispositions, test logs, baseline comparison, and the final summary.Rollout evidence and next stage
Real-model smoke has not been run for this repaired head. This fix stage runs deterministic regression tests and Linux local-supervisor tests; these do not replace model/verifier evidence. The requested next stage is smoke: exercise a real-model OpenClaw context-overflow episode on single_agent_turn, a Harbor failed-turn episode, and DeepAgents' task-caused runner termination, inspect the agent/verifier behavior, then assess CI and rereview. The PR is marked ready for review at the author's explicit request; this evidence remains outstanding before merge.