Repository navigation
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
ananthsub
force-pushed
the
ananthsub/task-schemas/environment-task-schemas
branch
from
October 6, 2026 14:05
80ea2ad to
06482c1
Compare
ananthsub
force-pushed
the
ananthsub/task-schemas/environment-task-schemas
branch
from
October 6, 2026 17:02
06482c1 to
0b735d3
Compare
ananthsub
force-pushed
the
ananthsub/task-schemas/environment-task-schemas
branch
from
October 6, 2026 17:44
0b735d3 to
ff49e55
Compare
ananthsub
force-pushed
the
ananthsub/task-schemas/environment-task-schemas
branch
from
October 7, 2026 05:22
ff49e55 to
3e2ca45
Compare
responses_create_params was a framework-reserved row key, so collation never validated it, and every dataset was checked only against its resources server's schema. A dataset routed to an environment server that runs several agents had no way to declare the fields that server reads, and single-agent rows without a request passed validation. responses_create_params is now a task field of single-agent environment servers, declared once by SingleAgentTaskData. Environment servers ship a task_data.py under environment_servers/<implementation>/, and collation validates each dataset against two schemas: the routed environment server's, or SingleAgentTaskData for datasets routed by agent, and the bound resources server's. Each schema validates the fields it declares plus the fields neither declares, so extra="forbid" resources schemas need no change, and errors from both are reported. The three built-in environment servers declare SingleAgentTaskData. Rows that a preparation script already materialized, such as UserSim's, name their own taskset and are validated by their environment server at dispatch, so the environment schema does not validate them during collation. UserSim's environment server shares its resources server's TaskData. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
ananthsub
force-pushed
the
ananthsub/task-schemas/environment-task-schemas
branch
from
October 8, 2026 00:06
3e2ca45 to
4a55e44
Compare
This branch has not been 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 does this PR do?
Validates each dataset row against the schema of the environment server it routes to, composed with the bound resources server's schema.
responses_create_paramswas a framework-reserved row key, so collation never validated it, and each dataset was checked only against its resources server'sTaskData. An environment server that runs several agents had no way to declare the fields it reads, and a single-agent row without a request passed validation.Where this fits
Datasets reach an environment server in one of two ways today: run request rows route by their agent, and datasets that declare
taskset:are materialized during collation and route byenvironment_server_routes. The goal is one path, where every dataset declares a taskset and routes to an environment server:flowchart LR P["Preparation script<br/>task rows with a stable task_id"] --> C["Collation<br/>validates, computes metrics,<br/>materializes"] Y["Dataset YAML<br/>file + taskset"] --> C S["task_data.py schemas<br/>environment server + resources server"] -.-> C C --> R["Rollout collection<br/>routes by taskset"] T["environment_server_routes"] --> R R --> E["Environment server<br/>single-agent, multi-agent,<br/>or legacy_agent relay"]The UserSim stack (#3800 and #3802) has merged. UserSim's datasets already declare
taskset:and commit plain task rows, so they use the one path. Each step is additive, and datasets withouttaskset:keep working until the last one:flowchart TB S4053["PR 4053 (merged)<br/>tasksets route to servers<br/>with several agents"] S4060["PR 4060 (merged)<br/>metrics for<br/>materialized rows"] S3800["PR 3800 (merged)<br/>UserSim runtime"] S3802["PR 3802 (merged)<br/>UserSim validation tasks"] S4096["PR 4096<br/>stable, unique<br/>task IDs"] S4097["PR 4097<br/>metrics for<br/>every row"] S4098["PR 4098<br/>schema per<br/>environment server"] S4099["PR 4099<br/>legacy_agent relays<br/>serve tasksets"] SREF["Remove the bridge<br/>for already-materialized<br/>rows"] SNEXT["Later<br/>configs declare taskset:,<br/>then agent routing retires"] S4053 --> S4060 --> S3800 --> S3802 --> S4096 --> S4097 --> S4098 --> S4099 --> SREF --> SNEXT classDef done fill:#F1EFE8,stroke:#5F5E5A,color:#444441 classDef prereq fill:#FAEEDA,stroke:#854F0B,color:#633806 classDef this fill:#EEEDFE,stroke:#534AB7,color:#26215C,stroke-width:2px classDef next fill:#E1F5EE,stroke:#0F6E56,color:#085041 class S4053,S4060,S3800,S3802 done class S4098 this class S4096,S4097,S4099,SREF,SNEXT nextGray: merged. Purple: this PR. Green: other steps.
Base branch. This stack is based on
main. Review only this PR's own diff.Changes
responses_create_paramsis a task field of single-agent environment servers, declared once bySingleAgentTaskDatainnemo_gym/task_data.py. It is no longer inRESERVED_ROW_KEYS. Itsinputis optional, because a dataset'sprompt_configfills it during collation.task_data.pyunderenvironment_servers/<implementation>/.single_agent_turn,single_agent_turn_legacy, andlegacy_agentexportSingleAgentTaskData.TaskDataValidatortakes an optionalenvironment_adapter. Each schema validates the fields it declares plus the fields neither declares. A resources schema withextra="forbid"never sees the environment server's fields, so none of the existing schemas needs an edit. Errors from both schemas are reported for one row, and undeclared fields are reported against the resources server's schema.taskset:uses the routed environment server's schema and the schema of the resources server it binds.TasksetSchemasrecords them while configs load, the only step that has the run's routes.taskset:routes by agent, so it is a single-agent run request. It usesSingleAgentTaskDataand the schema of the resources server or self-contained agent that owns its data, as before.taskset_environment_serveringlobal_config.pyresolves a taskset's route, shared byresolve_dataset_agentand collation.environment_servers/nemo_user_sim/task_data.pyshares UserSim's resourcesTaskData, since its environment server reads the same task fields.environment_servers/, require every environment server to ship a schema, and check thatSingleAgentTaskDatamatches the runtimeSingleAgentTurnTaskInput.resources-server-apis.mdxdescribes the two schemas.Out of scope, for follow-up PRs: environment manifest validation, the Hugging Face upload check, and the environment scaffold still assume single-agent rows. Manifests and the scaffold only describe agent-routed environments today.
No issue is linked. This follows the dataset routing design for environment servers.
Validation
tests/unit_tests/test_task_data.py::TestEnvironmentServerSchemas: throughload_and_validate_server_instance_configsand collation, single-agent rows needresponses_create_paramswhether they route by agent or by taskset, a resources schema withextra="forbid"accepts them, an environment server with its own schema needs noresponses_create_paramsand both schemas report errors, and an environment server without a schema still validates the resources fields.tests/unit_tests/test_task_data.py: a materialized row in a dataset routed by agent needs noresponses_create_params, while a plain row in the same dataset still does. This test fails without the change.tests/unit_tests/test_task_data.py: the committed-data sweep uses the routed environment server's schema for datasets that declaretaskset:, as collation does, and the single-agent schema otherwise.gym dataset collate +mode=example_validationonresources_servers/nemo_user_sim/configs/nemo_user_sim.yaml: UserSim's committed task rows materialize with their own task IDs, schema validation is clean, and the committed metrics sidecar is unchanged.resources_servers/nemo_user_sim/testsandenvironment_servers/nemo_user_sim/testsfail only where they need theusersimpackage, identically onmain;gym env test --resources-server nemo_user_siminstalls it.pytest tests/unit_tests: the tests that fail here fail identically onmain; they need the sandbox, telemetry, or Slurm extras.pytest environment_servers resources_servers/terminal_bench_4/tests/test_benchmark_preparation.py: all pass.pre-commit runon the changed files: all pass.Rollouts
N/A. The change affects offline validation during collation and writes no different rows. The collation check described in the last PR of this stack ran on real repository configs with this change.
Compatibility and benchmark impact
task_data.pyare now checked forresponses_create_params, which they need to run.TaskDataValidatororvalidate_jsonl_rowsthat validate single-agent rows passenvironment_adapter=SINGLE_AGENT_TASK_DATA; without it,responses_create_paramsis reported as an undeclared field.