Repository navigation
Conversation
…relay `gym env init` now pairs a new resources server, environment or benchmark with simple_agent through the single_agent_turn Environment Server: each dataset declares a taskset, environment_server_routes maps it to `<name>_environment_server`, and that server inherits single_agent_turn and binds the resources server and agent with direct_http tool access. - --resources-server: train, validation and example each get their own taskset (`<name>_train`, `<name>_validation`, `<name>_example`). - --environment / --benchmark: the example dataset routes as `<name>_example`, the benchmark dataset as `<name>`. A reused verifier without a bundled Environment Server gets the same server, bound to the reused resources server; one with a bundled server still inherits it. - external-agent-loop keeps its legacy_agent relay: its agent runs the episode in /run, which agent sessions never call. - The workload config is dumped one top-level block at a time, replacing a split on the agent name that broke the single_agent_turn config path for names such as `single`. new-environment.mdx describes the generated server and the collate step a standalone server's smoke needs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
Contributor
Author
|
/ok to test 48b4848 |
Contributor
This branch had an error being 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.
What
gym env initnow generates thesingle_agent_turnEnvironment Server with a typed taskset, instead of alegacy_agentrelay in front of the agent.New benchmarks are meant to run through an Environment Server's agent sessions, and a
legacy_agent/runrelay is not allowed in new work. The docs that teach this path (#6031, #6032) still had to tell readers to replace the relay the scaffold wrote. With this change, the generated config and the tutorials agree.Generated shape (all scaffolds except the ones noted below):
Changes in
nemo_gym/environment/scaffold.py:--resources-server NAME. Train, validation and example each get their own taskset (<name>_train,<name>_validation,<name>_example). Rows without an explicit id get positional task ids that restart in each split, so a shared taskset would give different train and validation tasks the same identity.--environment/--benchmark. The example dataset routes as<name>_exampleand the benchmark dataset as<name>(the taskset benchmark preparation already defaults to).--reuse-verifier. If the reused config bundles an Environment Server in front of its agent, the workload still inherits that server, unchanged, with flat rows and no taskset. If it bundles none, the workload gets the samesingle_agent_turnserver, bound to the reused resources server.external-agent-loopkeeps itslegacy_agentrelay. This profile's agent runs the whole episode inrun()and is told to makeresponses()raiseNotImplementedError. Agent sessions call only/v1/agent_sessionsand/v1/responses, never/run, so undersingle_agent_turnthis agent could not run. Moving the profile to agent sessions needs a different agent template and a different profile inference rule invalidation.py; that belongs in its own PR.custom-gym-agent-loopdoes move: its agent subclassesSimpleAgentand overridesresponses(), which is the handler the session route calls, and it inherits the session hooks.<name>_agent. With the new config path, that split corruptedenvironment_servers/single_agent_turn/...for names such assingleore.fern/.../contribute/environments/new-environment.mdxdescribed the relay the scaffold generated. It now describessingle_agent_turnand theexternal-agent-loopexception, and adds the collate step a standalone server's smoke needs:single_agent_turntakes typed rows, so--agentwith the flatexample.jsonlno longer works. This PR doesn't touch the pages #6031 and #6032 edit.No issue: this follows from the review rule for new benchmarks and from the docs PRs above.
Compatibility
gym env initgenerated before this change are unchanged and keep working.gym dataset collate --resources-server NAME --mode example_validation --output-dir DIR. Then rungym eval run --no-serve --resources-server NAME --input DIR/example.jsonl.--agent NAME_simple_agentwith flat rows no longer applies. The generated config's comment gives the collate command.Validation
tests/unit_tests/environment/test_environment_scaffold.py: 78 passed. Locally,test_generated_python_passes_repo_lint_and_formatfails identically onorigin/main, because the local venv's ruff (0.12.11) sorts imports differently from the repo's pin. This PR changes no generated Python.test_scaffold_routes_its_taskset_through_single_agent_turn, run for every kind × profile. It resolves the generated config the way a run does, and checks the route, the dataset taskset, the inheritedsingle_agent_turnblock (entrypoint, bindings,direct_http), that the basesingle_agent_turninstance moves rather than starts, and thatresolve_dataset_agentreaches the agent through the route. Forexternal-agent-loopit checks the relay, with no taskset and no routes.test_scaffold_named_like_part_of_a_config_path_keeps_that_pathcovers the namessingleande.single_agent_turnblock. Updated reuse tests check thesingle_agent_turnserver for a reused config without a bundled server, and that an inherited server gets no taskset.test_environment_onboarding.py(13 passed) andtest_environment_publication.py(11 passed), which build on the scaffold.demo, benchmarkbench, environmentsingleon custom-gym-agent-loop, environmentexton external-agent-loop, benchmarkdrvon external-rollout-driver):gym env validate --config <config>: valid for all five.--configchecks each Environment Server block againstSingleAgentTurnEnvironmentServerConfig. A config with a misspelledresources_tool_transportsis rejected.gym env validate --manifest <workload>/manifest.yaml: valid for the four workloads. The inferred profiles and warnings are the same as before (template agents still delegate tosuper()).gym dataset collate --mode example_validation: the standalone and environment example rows become{"task_id": {"taskset": "demo_example", "task_id": "0"}, "task_input": {...}}(andsingle_example).pre-commit run --all-files: passed. Commits are DCO signed off.Rollout evidence
N/A for now. This changes a config generator, not an existing environment or agent: no shipped server, config or dataset changes. I have not run an end-to-end scripted-model smoke of a generated workload (
gym env startplus one collated example throughsingle_agent_turn). The workstation for heavy runs was out of disk today. I'll add it here before this PR leaves draft.🤖 Generated with Claude Code