Repository navigation
feat: add legacy environment servers - #3724
Merged
marta-sd merged 23 commits intoSep 29, 2026
Merged
Conversation
ananthsub
force-pushed
the
ananthsub/episode-orchestration-09-legacy-adapter
branch
from
September 28, 2026 15:48
de5d9b0 to
a2542b5
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-09-legacy-adapter
branch
from
September 28, 2026 18:49
3f27818 to
fc39502
Compare
Benchmarks that landed after the last sweep declare an agent with no environment server, which rollout collection cannot reach. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marta Stepniewska-Dziubinska <martas@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marta Stepniewska-Dziubinska <martas@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marta Stepniewska-Dziubinska <martas@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marta Stepniewska-Dziubinska <martas@nvidia.com>
…an environment server Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marta Stepniewska-Dziubinska <martas@nvidia.com>
… servers A flat row routes to the environment server that fronts its agent. The lookup returned the first server in config order, so a second server for the same agent silently received no rows or aggregation. It also rescanned the whole config for every dispatched row. Build the agent-to-server map once and resolve every agent before dispatch. An agent with several servers now raises AmbiguousEnvironmentServerError before any rollout starts; twin servers for an agent that no row routes by remain valid. Aggregation reuses the same map. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
SingleAgentTurnResult is now the verify response itself, so the legacy projection dumps the result directly and adds only agent_ref. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
…cit task IDs Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: Marta Stepniewska-Dziubinska <martas@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marta Stepniewska-Dziubinska <martas@nvidia.com>
marta-sd
force-pushed
the
ananthsub/episode-orchestration-09-legacy-adapter
branch
from
September 29, 2026 08:57
b4e05d4 to
1af0b1c
Compare
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/36548336483 |
marta-sd
deleted the
ananthsub/episode-orchestration-09-legacy-adapter
branch
September 29, 2026 09:31
5 tasks done
7 tasks
This was referenced Oct 12, 2026
Open
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.
What does this PR do?
Adds compatibility Environment Servers before environment-specific Resources and Agent migrations:
legacy_agentrelays existing Agent/runand/aggregate_metricscontracts without interpreting them.single_agent_turn_legacyconverts legacy flat rows to the single-agent-turn protocol and returns its result in the legacy result shape, adding onlyagent_ref.Rollout collection routes each flat row to the Environment Server that fronts its Agent. The Agent-to-Environment-Server map is built once, and every Agent in a batch is resolved before any rollout is dispatched. An Agent fronted by several Environment Servers raises
AmbiguousEnvironmentServerErrorbefore dispatch, instead of silently sending every row to the first one in config order. Several Environment Servers may still front one Agent when no row routes by that Agent.Compatibility flow
This is the compatibility flow for existing single-agent environments. Other Environment Servers may coordinate different participants.
sequenceDiagram participant C as RolloutCollector participant E as LegacyEnvironmentServer participant A as ExistingAgentServer C->>E: POST /run with legacy row E->>A: Relay existing /run A-->>E: Existing result body E-->>C: Unchanged result bodyStack position
Part 2 of 6. Previous: #3717. Next: #3718.
No issue is linked because this is one layer of the Environment Server stack.
Validation
uv run pytest tests/unit_tests/test_global_config.py tests/unit_tests/test_rollout_collection.py -quv run pytest environment_servers/single_agent_turn_legacy/tests/test_app.py -quv run pytest environment_servers/legacy_agent/tests/test_app.py -qRollouts
example_single_tool_callwith Simple Agent was run throughlegacy_agentagainst a real model. The relay returned the same status, result fields, andSet-Cookieas calling the Agent's/rundirectly, and passed a malformed request's 422 through unchanged. End-to-end evidence for the whole stack is on #3722.Compatibility and migration impact
Every runnable Agent instance now needs an Environment Server in front of it. Out-of-tree configurations, including NeMo RL configurations, must add a
legacy_agentdeployment or runscripts/add_legacy_agent_environment_servers.py. Legacy request and result bodies do not change.A run whose rows route by an Agent that several Environment Servers front now fails before dispatch with an error naming the candidates.