Repository navigation
chore(configs): move simple_agent configs off the legacy_agent relay - #4953
Conversation
|
/ok to test b6494e9 |
yaoyu-33
left a comment
There was a problem hiding this comment.
Team review of the regenerated configs. The YAML diff is exactly the generator's output (byte-identical on a fresh run), comments are preserved, every switched block validates against SingleAgentTurnEnvironmentServerConfig, and the three switched servers that override seed_session (critpt, example_single_tool_call, interactive_browser) handle the typed body.
Three switched configs break in ways the resolve-before/after check did not catch (the affected recipes were already failing for unrelated reasons on both sides, or only fail at runtime). There is also one opt-in observability regression that applies to every switched config.
Not inline:
- Behavior changes users will see (episode timeout now enforced, agent outcome policy, server-owned close) have no release-notes entry.
- The real-model reward-profile comparison is still pending, as the body says.
|
/ok to test ae44e0c |
|
/ok to test 4b93cc1 |
Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test 77a482f |
…_turn_legacy The main merge brought in two benchmarks that override `legacy_agent` on a parent environment server this PR already switched, so each resolved to both keys and failed as an almost-server. Point their overrides at `single_agent_turn_legacy`, and update the tests from main that still expect the relay or the generic config class. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
/ok to test 51c3dee |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41124380501 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41129254996 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41130480746 |
What and why
This PR runs #4952's
scripts/add_legacy_agent_environment_servers.py --switch-simple-agentover the repository. The generated migration changes 289 config files: 296 relays in front ofsimple_agentbecomesingle_agent_turn_legacyservers of the same name. A crash in those episodes then repeats only the current step instead of the whole episode, andsimple_agentresumes inside its turn. That is the largest single cut in restart cost in the migration roadmap (phase 1).Typical diffs:
legacy_agentkey becomessingle_agent_turn_legacy, and the block gains the direct HTTP grant. The migrated timeout defaults live inSingleAgentTurnLegacyEnvironmentServerConfigrather than every YAML block.legacy_agent:becomessingle_agent_turn_legacy:. It keeps_inherit_fromand its agent name.22 relays stay on the relay, as the script reports:
seed_sessiontakes only the legacy body, notResourcesSeedSessionRequestworkplace_assistant(2),openenv(3),newton_bench,indirect_prompt_injection,example_session_state_mgmt, and the SWE example configsdenovo_swe,r2e_gym,scale_swe,swe_gym,swe_internal_v1,swe_next,swe_rebench,swemer_oml,swemer_ultra,swemer_v1,swemer_v2/verifyreads the row's_ng_rollout_indexand cohort keys, whichsingle_agent_turn_legacydoes not forwardgenrm_environment_server,genrm_simple_agent_reasoning_off_environment_server(genrm_compare)benchmarks/ruler/config_nemotron_3_256k.yamlis missing onmain)ruler_benchmark_environment_serverinbenchmarks/nemotron_3_ultra/benchmarks_no_external.yamlThe seed group moves once those resources servers accept the typed seed (separate resources-session migrations).
genrm_comparemoves once the Environment Server forwards rollout coordinates. The broken include is pre-existing and not touched here.hleandapex_shortlistswitch: their opencode/pi recipes keep the original benchmark Environment Server names and explicitly replace the inherited definition with alegacy_agentrelay. The two HLE search variants inherit the same overrides. #4952 removes the inherited link and migrated server type before configuration inheritance, so each recipe still resolves exactly one relay for its harness.Tests and docs that read these configs now use the new key: five
indic_*tests,critpt_custom_grader,long_transduction, plusabout/architecture,agent-server/indexand the system design note, which now say most shippedsimple_agentconfigs use it and why the rest stay. Thesuper35container build now also coverssingle_agent_turn_legacy(component count 17 → 18), so its prebuilt check finds 16 core server environments instead of 15.Design
Markers: green NEW, orange CHANGED, red dashed BROKEN; the label text says the same, so the diagrams read without color.
1. One episode, before and after
Before:
legacy_agentrelay. The episode is one request.sequenceDiagram autonumber participant RC as Rollout collection participant LA as legacy_agent (relay) participant AG as simple_agent /run participant M as Model participant RS as Resources server RC->>LA: /run (flat row) LA->>AG: /run (the whole episode is this one request) AG->>RS: /seed_session (flat body) loop model and tool turns AG->>M: /v1/responses AG->>RS: POST /{tool} end AG->>RS: /verify AG-->>LA: result LA-->>RC: result Note over RC,RS: a crash anywhere repeats the whole /run from its inputAfter:
single_agent_turn_legacy. The episode runs in steps, with checkpoint boundaries between them.sequenceDiagram autonumber participant RC as Rollout collection participant ES as single_agent_turn_legacy (CHANGED) participant AG as simple_agent session participant M as Model participant RS as Resources server RC->>ES: /run (same flat row, same server name) Note over ES: checkpoint boundary: seed ES->>RS: /seed_session (typed) → session cookie ES->>AG: /v1/agent_sessions (direct_http grant to RS) Note over ES: checkpoint boundary: agent turn ES->>AG: /v1/responses loop model and tool turns (the agent checkpoints inside its turn) AG->>M: /v1/responses AG->>RS: POST /{tool} through the grant end Note over ES: checkpoint boundary: agent close ES->>AG: /v1/agent_sessions/close Note over ES: checkpoint boundary: verify ES->>RS: /verify (session cookie) Note over ES: checkpoint boundary: return ES->>RS: /close_session ES-->>RC: flat result row Note over RC,RS: a crash repeats only the current step, and simple_agent resumes inside its turn2. How the config files change
A parent relay gets the full block, and a benchmark child only renames its key. A benchmark that declares no server reaches the parent through Gym's agent rename (see #4952).
flowchart LR subgraph rs["resources_servers/math_with_judge/configs/math_with_judge.yaml"] P["math_with_judge_environment_server<br/>CHANGED: legacy_agent → single_agent_turn_legacy<br/>NEW: resources_tool_transports: [direct_http]<br/>agent_server: math_with_judge_simple_agent"] end subgraph bm["benchmarks/aime24/config.yaml (config_paths: math_with_judge.yaml)"] C["aime24_math_with_judge_environment_server<br/>_inherit_from: math_with_judge_environment_server<br/>CHANGED: key legacy_agent → single_agent_turn_legacy<br/>agent_server: aime24_math_with_judge_simple_agent"] end subgraph ix["benchmarks/indic/math_500/config.yaml (declares no server)"] I["indic_math_500_..._simple_agent<br/>_inherit_from: math_with_judge_simple_agent"] end C -- "_inherit_from (parent is consumed as a template)" --> P P -. "Gym follows the agent rename; the server binds this agent's resources server" .-> I class P,C changed classDef new fill:#e6f4ea,stroke:#1e8e3e,stroke-width:2px,color:#111 classDef changed fill:#fff4e5,stroke:#e8710a,stroke-width:2px,color:#111 classDef removed fill:#fce8e6,stroke:#d93025,stroke-width:2px,stroke-dasharray:5 5,color:#1113. Which relays switch
flowchart LR T["318 legacy_agent relays<br/>in front of simple_agent"] --> S["296 switched<br/>289 files<br/>→ single_agent_turn_legacy"] T --> L["19 stay: resources seed_session takes only the legacy body<br/>workplace_assistant ×2, openenv ×3, newton_bench,<br/>indirect_prompt_injection, example_session_state_mgmt,<br/>11 SWE example configs"] T --> G["2 stay: verify reads _ng_* rollout coordinates<br/>genrm_compare"] T --> I["1 stays: include missing on main<br/>nemotron_3_ultra/benchmarks_no_external.yaml"] T --> Z["0 blocked by MCP or by a second direct HTTP grant"] class S new class L,G,I changed classDef new fill:#e6f4ea,stroke:#1e8e3e,stroke-width:2px,color:#111 classDef changed fill:#fff4e5,stroke:#e8710a,stroke-width:2px,color:#111 classDef removed fill:#fce8e6,stroke:#d93025,stroke-width:2px,stroke-dasharray:5 5,color:#111Validation
Original migration snapshot validation:
--switch-simple-agentrun on feat(scripts): switch simple_agent relays to single_agent_turn_legacy #4952's head is byte-identical to this PR's 278 files.--switch-simple-agent --checknow reports nothing left to switch and 22 staying; the default--checkadds nothing.gym env resolveon thehleandapex_shortlistdefault and opencode/pi recipes,aime24andindic/math_500gives one Environment Server per run:single_agent_turn_legacyfor the benchmarks,legacy_agentfor the harness variants.indic_*,critpt_custom_grader,long_transductionand generator tests, 241 passed. The super35 prebuilt check expects 16 core environments, matching CI's count on Linux.pre-commit run --files <changed files>: clean.On the first head (
b6494e94e, beforegenrm_comparestayed on the relay):gym env resolveon all 638 server configs, paired withopenai_modelwith dummy++keysandNEMO_GYM_ALLOW_UNSUPPORTED_PAIRING=1. The same 128 failed on both sides, needing judge models or values not supplied. This check missed the six variant recipes, which needed sandbox env vars and so already failed on both sides.simple_agentbehind exactly one Environment Server, and every switched server able to bind its agent's resources server.Preserved-name restack validation
git range-diffconfirms all five existing commits retain their patches.pre-commit run --all-filespass; the combined fix(env): own resources bindings and resolve inherited renames #5108 stack passes 1,184 focused tests. DCO trailers and whitespace checks pass.Rollout evidence
The runs used real Gym servers with a stub Responses model, not a real one: it calls the first offered tool once, then answers. Each run started with
gym env start, logged requests with+uvicorn_logging_show_200_ok=true, and collected two rows withgym eval run --no-serve.example_single_tool_call(stateful, tool call)/run→ seed → agent session → turn (POST /get_weatherthrough the direct HTTP grant) → agent close →/verify→ resources closebenchmarks/gpqa(child relay, noresources_serverset)gpqa_mcqa_resources_serverthrough the agentbenchmarks/indic/math_500(reached through Gym's agent rename)math_with_judge_environment_serverseeded and verifiedindic_math_500_math_with_judge_resources_serverReal-model smoke (first heads). A paired baseline-vs-migrated run on the earlier heads (#4952
2a31fc20das baseline, #4953b6494e94emigrated), with real benchmark data, model generation, tools and verifiers, on a workstation and HSG:gym eval runandgym eval profile, IFEval, HumanEval+ and MBPP+, LiveCodeBench v5, ASR Leaderboard / LibriSpeech-PC / Numb3rs, DAPO and LongCodeBench.genrm_compareverifiers returned 422 after 32 successful policy calls (now on the relay), and the sixhle/apex_shortlistharness recipes stopped resolving (now behind their own relay).Re-check on the fixed heads (#4952
52e2e2c, this PR4b93cc1, #4954521205f), by an independent reviewer:hle/apex_shortlistharness recipesgenrm_comparerollout and cohort coordinatesNot done: a full reward-profile comparison per batch with a real model, which the roadmap asks for; a rerun of the full smoke matrix on the fixed heads; and
genrm_comparejudge scoring, which needs a compatible judge model.Compatibility
single_agent_turn_legacy:default_episode_timeout_seconds: 21600, the relay's own default, which the relay didn't enforce./run.skip_verification(global or on the agent) keeps working through feat(environment): honor skip_verification in single_agent_turn #4949.Review fixes included (2026-10-23):
da8dc7b80: composition now uses alegacy_agentrelay for agents without session support.d633295b1: captured session tool calls are preserved through close and counted by the collector.These commits address the two outstanding inline comments. Separate migration gates remain: the rebased MMRB child overlays and full reward-profile qualification. Session support alone also does not establish compatibility with every required tool grant: Kilo's default GPQA pairing still rejects the required direct HTTP grant; this follow-up does not qualify that pairing.
Review follow-up validation (2026-10-23)
At
da8dc7b80a1c286da6dfd7de911c223d505a99c4, in an isolated checkout with Python 3.13.14 and all 31 direct dependency constraints satisfied:python -m pytest --import-mode=importlib tests/unit_tests/test_global_config.py tests/unit_tests/test_add_legacy_agent_environment_servers.py environment_servers/single_agent_turn/tests/test_app.py environment_servers/single_agent_turn_legacy/tests/test_app.py responses_api_agents/simple_agent/tests/test_app.py tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_checkpoint_agent.py tests/unit_tests/test_harness_conformance_ci.py -o addopts='-q --tb=short' -o log_cli=false: 1,147 passed.9fe6a1a4cand pass with the repairs. The previous collector result was([], 0); the fixed result retains the completed lookup tool and output42, with one tool call.gym env resolvewith GPQA,opencode_sandboxed_agent, and dummy OpenAI model settings now selectslegacy_agent; the same command on the previous head selectedsingle_agent_turn_legacy.pre-commit run --all-files: passed without source changes.git diff --checkand DCO trailers checked. An independent reviewer inspected both imported fixes and identified the remaining Kilo pairing limitation above./runroute; the capture repair changes observation metadata. The integration test exercises the real agent, environment, and collector with scripted model/tool replies. Existing broad rollout qualification gaps remain.Update (2026-10-29): after #4952 merged
The branch was updated by merging
main, not by rebasing, so the ten existing commits are unchanged. Three commits are added:d0eb7d595mergesmain(c5a86197b, which includes feat(scripts): switch simple_agent relays to single_agent_turn_legacy #4952 as merged). Conflict resolutions:scripts/add_legacy_agent_environment_servers.py: main's feat(scripts): switch simple_agent relays to single_agent_turn_legacy #4952 version, with this branch's session-less fallback (00788d932) applied.tests/unit_tests/test_add_legacy_agent_environment_servers.pyandtroubleshooting/configuration.mdx: main's feat(scripts): switch simple_agent relays to single_agent_turn_legacy #4952 version.responses_api_agents/simple_agent/app.pyand its tests: main's version. fix(agent): make Simple Agent P0 conformant #5117 already reportssimple_agentsession tool calls as observations, which supersedes theapp.pychange in7c401e682. That commit'ssingle_agent_turnend-to-end test merges unchanged and passes.35ffded88switches the relays main added after this branch's snapshot (11 files). It reruns the generator from scratch onmain:benchmarks/hle_diamond/{config,text}.yamlandbenchmarks/genrm_mmrb{1,2}/dataset.yamlare child relays over a parent this branch already switched. Without the switch, each merges into an instance with bothlegacy_agentandsingle_agent_turn_legacyand fails to load. An incremental rerun of the generator misses them.beam(4 files),vision_arena_v1(2) andmimo_music.a50d676a2updatesmimo_music's config test and README tosingle_agent_turn_legacy.mimo_musicreachedmain(feat(mimo-music): add ABC composition resources server #3704) after the snapshot, so its server test still readlegacy_agentand failed in CI's server suite.Validation at
35ffded88onmainc5a86197b, unless noted:--switch-simple-agentrun onmainis byte-identical to all 289 changed YAML files.--switch-simple-agent --checkreports nothing left to switch and 22 staying; the default--checkadds nothing.mainequals the change made by this branch's own commits (07650ac23..00788d932), exceptsimple_agent, as described above. No content from the pre-merge feat(scripts): switch simple_agent relays to single_agent_turn_legacy #4952 commits came back.hle_diamond(config, text, opencode),genrm_mmrb1(dataset, genrm),genrm_mmrb2,beam,vision_arena_v1,hle/opencodeandgpqato one Environment Server each.hle_diamond/text.yamlresolves to the same server settings asconfig.yamlexcept the agent name.single_agent_turn,single_agent_turn_legacy,simple_agenttests and every test file this branch changes: 758 passed, 6 skipped.tests/unit_tests: 12,122 passed. The other 34 failed and 40 errored on cleanmainc5a86197bas well (git, Harbor, OpenSandbox and wandb in this environment).tests/unit_tests/telemetrywas skipped becauseopentelemetryis not installed here.mimo_music'stest_review_regressions.py(ata50d676a2): 8 passed; without the fix, the CI failure reproduces.ruff checkandruff format --checkon the changed Python files: clean.Rollout evidence for this update: N/A. The 11 configs get the same generator rewrite as the configs rolled out above, and were checked with Gym's parser. No new model run was made for them.
Timeout defaults cleanup (2026-10-29)
Commit
150748ac2centralizesdefault_episode_timeout_seconds: 21600andcleanup_timeout_seconds: 180inSingleAgentTurnLegacyEnvironmentServerConfig. The 161 migrated parent blocks, the canonical example, and the migration generator now use these defaults. The genericsingle_agent_turnconfig is unchanged.Explicit overrides remain supported, including callers passing a typed parent config. Eight existing Partner IF configurations now explicitly set the episode timeout to
null, preserving their previously uncapped behavior. GDPval's explicit timeout remains unchanged.Validation:
pre-commit run --all-files,git diff --check, andscripts/add_legacy_agent_environment_servers.py --switch-simple-agent --checkpassed. The generator reports zero files to touch, zero relays to switch, and 22 remaining on the relay.Hermes CI regression fix (2026-10-30)
Commit
20f275b5bupdates the Hermes recipe test to validatesingle_agent_turn_legacysettings withSingleAgentTurnLegacyEnvironmentServerConfig, matching the runtime loader. The generic config still requires an explicit cleanup timeout, so using it after the canonical YAML deduplication caused both parameterized recipe cases to fail in server shard 5 and Hermes conformance.Validation: all four tests in
responses_api_agents/hermes_agent/tests/test_recipe.pypassed with the pinned Hermes dependency (26bb847a);pre-commit run --all-filesandgit diff --checkpassed. This changes only the test's config type, so real-model rollout evidence is N/A. Kilo's separatemodel_errorconformance failure was already present ata50d676a2and is unchanged by this fix.Main merge and conflict resolution (2026-10-30)
Merge commit
77a482fffbrings inmainat85193811bwhile preserving the PR's existing commits. The four conflicts were import changes in the Codex, OpenClaw, Hermes, and global-config tests. The resolution keeps the specific legacy config class and session-agent registry while adopting main's newnemo_gym.configpaths. Three automatically merged references also needed updates: the generator's public config import, the environment test's config import, and the agent-registry test's repository-root lookup afterglobal_config.pymoved. The registry constant is exported through the new config public API.Validation on the merged tree:
26bb847a).pre-commit run --all-filespassed, including the new import-linter hook. The PR diff against merged main passesgit diff --check.--switch-simple-agent --check: zero files to touch, zero relays to switch, 22 remaining on the relay.🤖 Generated with Claude Code