Repository navigation
Conversation
Simple Agent, the harness-conformance reference, built its failed session response and its ng_agent_outcome by hand: every model HTTP error was model_request_error with its status. It therefore missed two team decisions the ladder applies to the other harnesses: a 4xx other than 408/425/429 before any model reply is model_request_rejected (failed, not retried), and a context overflow the model server propagates is incomplete and graded. The session error path now fills RunEvidence and returns finish_response: the error is model_http_error_outcome(status, error_body=...) for an HTTP error and the typed model_policy_response_timeout otherwise, and model_replied is whether an earlier step of the loop got a model reply. For a rejected request the reply's failure_report selects an agent failure of that kind, caused by the model error, as it does for the policy timeout, so the Environment Server records model_request_rejected on the failure row; a report that selected the model's HTTP error would contradict the outcome. The report's construction and merging, the policy-timeout path and the legacy /run path are unchanged. The README describes the session outcomes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
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). Review the diff against
feat/agent-outcome-ladder; it touches only Simple Agent.What changed and why
Simple Agent is the harness-conformance reference, but no adapter PR moved it onto the ladder. Its agent-session error path built the failed
NeMoGymResponseand wroteng_agent_outcomeby hand, so every model HTTP error wasmodel_request_errorwith its status. That misses two team decisions the ladder already applies to the other harnesses:model_request_rejected(failed, neither graded nor retried).incompleteand graded.As a result Simple Agent failed the conformance
model.terminal_errorcheck onmodel_errorandmodel_401, and the calibratedmodel_errorhealth expectation.responses_api_agents/simple_agent/app.py(session path of_create_episode, theexcept ClientResponseErrorblock):RunEvidence(has_result=False, timed_out=False, model_replied=..., error=...)and returnsself.finish_response(response, evidence).errorismodel_http_error_outcome(error.status, error_body=<response content>)for an HTTP error, andAgentOutcome(model_policy_response_timeout)when the reply shows a confirmed policy-response timeout.model_repliedis whether an earlier step of the loop got a model reply (step > 1). Each step calls the model once and continues only after its reply. A restored boundary keeps its step, so restored steps count. It is per activation, like the other adapters' per-run evidence. In a multi-activation session, a rejected first call of a later activation is thereforemodel_request_rejected.failure_report: the Environment Server takes the failure that the reply'sfailure_reportselects as the episode failure's cause and kind, and it treats a selected failure that contradictsng_agent_outcomeas inconsistent evidence. For a rejected request, Simple Agent now selects an agent-boundarymodel_request_rejectedfailure caused by the model error. This is the same pattern its policy-timeout path already uses. Without it, the failure row would have no kind (environment_server_failed), as the A run below shows formodel_401. The report's construction (reply_report/report_for_current_request) and the merge of the model server's forwarded report are unchanged.error_typestill names the error the run ended on (model_request_error,model_context_limitormodel_policy_response_timeout).not model_replied, which is the same as the oldstep == 1./runpath (it still raises), Simple Agent's own retries (max_model_retriesfor 408/425/429/5xx only, which is decision 6), and the body-failure and unreadable-report raises.responses_api_agents/simple_agent/README.mddescribes the session outcomes.Tests (
responses_api_agents/simple_agent/tests/test_app.py). The oldtest_terminal_model_http_error_returns_cause_and_zero_usagepinnedmodel_request_errorfor 400/401/422. It is replaced by per-event tables. Each case asserts the response status,ng_agent_outcome,ng_agent_stop_reason, the default Environment Server action and recorded failure kind (agent_response_actionwithAgentOutcomePolicyConfig()), the endpoint's message, the usage and the invocation:model_request_errorN/retry; a context overflow → incomplete/verify. Each case runs with and without the model server's forwarded report.model_policy_response_timeout, agent-boundary selected failure).Score and disposition changes
The main column comes from code reading at
bb2e2fced5. Simple Agent is the same there as on main, and #5870 does not touch it. (t) marks a row that a test on the base pins, and (s) a row the A conformance run below shows. Actions: verify = graded, retry = episode retried up to the attempt cap, fail = neither. Rows marked changed change disposition.context_length_exceeded), before or after a replymodel_request_error400 → verify (s)LACKS)model_policy_response_timeout→ Environment Server timeout ruleng_agent_outcomeno longer serializes a nullstatus_code)max_model_retries)model_request_errorN → retry (t)(s)model_request_error401 → fail; failure row has no kind (t)(s)model_request_rejected→ fail; row kindmodel_request_rejectedmodel_request_error400 → verify (graded, reward 0) (t)(s)model_request_rejected→ failmodel_request_errorN → verify (400/413/422) or fail (401/403/404)/runmodel errorValidation
All heavy work ran on a Linux workstation (Python 3.13.14). Nothing heavy ran on the Mac.
pytest responses_api_agents/simple_agent/tests: 168 passed. Against the baseapp.py, 14 of the 17 new cases fail. The 3 that pass are the unchanged after-reply 400/401/503 rows.Neighbouring suites:
environment_servers/single_agent_turn/tests,simple_agent_with_compaction,agentic_turn_simulation_agent,non_executing_simple_agent,labbench2_vlm_agent,tests/unit_tests/agents,tests/unit_tests/rollouts/test_rollout_collection.pyandtest_simple_agent_body_store.py. All passed except two that the test environment cannot run:test_outcome_policy.py::test_upload_evidence_roundtrips_*needscloudpickle, which the venv lacks (same failure without this PR), andgdp_pdf_agentneedsPIL. Its tests mock_create_episode.pre-commit run --fileson the three touched files: passed.Harness conformance, A/B, scripted model (no real model), local servers, concurrency 1. A = test(conformance): add outcome-ladder scenarios #5873 head
90a4af722c(conformance scenarios, which contains feat(agent): add the shared outcome ladder for harness runs #5870bb2e2fced5). B = A merged with this PR, with no conflicts; the trees differ only in the two Simple Agent files.Required scenarios: A exit 1, B exit 0 (P0 passes). Full Simple Agent suite: A exit 1, B exit 0.
model_errormodel_request_error400 → verify, reward 0;model.terminal_error✗,health.rollout_token_count_mismatch✗model_request_rejected→ fail, row kindmodel_request_rejected; E ✓model_401model_request_error401 → fail, row kind none;outcome.ladder✗,outcome.disposition✗, E ✗model_request_rejected→ fail, row kindmodel_request_rejected; H ✓ L ✓ D ✓ E ✓context_overflowmodel_request_error400 → verify, reward 0;outcome.target(P1) ✗model_503model_request_error503 → retry; R ✓ E ✓tool_success,tool_failure,usage_omitted,retry_429,retry_500,context_overflow_length,judge_verifier,verifier_failure,context_compaction)deadline_before_reply,deadline_after_replyandharness_no_resultdo not apply to Simple Agent (no run deadline, no harness process).Rollout evidence
Scripted-model conformance only (above). The scripted provider drives each error through the real Gym model server, Simple Agent,
single_agent_turn_legacyand rollout collection. A real-model run is N/A: the change is confined to the model-HTTP-error branch, which a working model endpoint never takes, and the successful scenarios are unchanged in the A/B above.Notes and leftovers
model_request_errorfailure row (for example 503) still carries no failure kind on both A and B. Simple Agent's reply report selects nothing for a plain HTTP error, so the Environment Server takes the action fromng_agent_outcomealone and recordsenvironment_server_failed. Selecting a matching failure for every failed outcome would fix that and is a separate change.simple_agent_with_compactionandagentic_turn_simulation_agentoverride_create_episodeand do not use this path. Neither buildsng_agent_outcome.model_errorscenario expectsmodel_request_rejected, which Simple Agent now reports.🤖 Generated with Claude Code