Skip to content

feat(rollout-collection): route mixed native and compatibility tasksets per row - #3576

Merged
ananthsub merged 2 commits into
ananthsub/episode-orchestration-10-rollout-routingfrom
adasif/mixed-taskset-routing
Sep 23, 2026
Merged

ananthsub merged 2 commits into
ananthsub/episode-orchestration-10-rollout-routingfrom
adasif/mixed-taskset-routing

Conversation

@adil-a

@adil-a adil-a commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Lets one rollout-collection batch mix native (materialized) tasksets and compatibility-routed flat rows, with no new agent × resources pairing, and keeps the chosen environment server's identity on every row through shards, retries and results.

  • A materialized task (task_id.taskset plus task_input) now routes by environment_server_routes in every environment_routing_mode; it is the native episode request and no agent-server /run accepts it.
  • A flat row keeps following the mode: agent (default) resolves the row's own environment server at dispatch, as today; legacy sends every flat row to environment_server_name; taskset stays native-only and rejects flat rows, so a native run cannot silently pick up legacy input.
  • A materialized row whose taskset has no entry in environment_server_routes fails at preprocessing with the missing route named. (feat: route native tasks through environment servers #3491 no longer has a tasksets config block, so routes are the only declaration.)
  • Two knobs that cannot apply to a materialized row now fail with the fix named instead of a KeyError: num_repeats_add_seed (the seed lives in the top-level prompt, which a materialized row keeps under task_input).
  • No config or YAML changes: routes point at existing environment-server deployments, and flat rows reach the legacy_agent servers that feat: add legacy environment servers #3490 generates in front of each existing pairing.

The _ng_environment_server stamp, written once at preprocessing, already reaches the materialized input file, resume retries (_load_from_cache re-reads the stamped rows) and result rows; this PR does not change that path.

Interaction flow

sequenceDiagram
    participant C as Rollout collector
    participant N as Native environment server, one per taskset route
    participant L as legacy_agent environment server, one per pairing
    participant A as Agent server

    Note over C: preprocess stamps _ng_environment_server once per row
    Note over C: materialized row routes by task_id.taskset, flat row follows the routing mode
    C->>N: POST /run with the episode request, episode_id plus task
    C->>L: POST /run with today's flat row
    L->>A: relay /run
    N-->>C: SingleAgentEpisodeResponse
    L-->>C: legacy result
Loading

Stack position

Stacks on #3491 (part 12, ananthsub/episode-orchestration-10-rollout-routing) and touches only nemo_gym/rollout_collection.py, which #3492 does not modify. It can be squashed into #3491 if preferred, since it changes the semantics of the routing mode that PR introduces.

Follow-up (separate PR): aggregate metrics grouped by _ng_environment_server instead of agent_ref.name, and native failure replies written to the failures sidecar, so identity also persists through gym eval aggregate and retries of native episodes.

Validation

  • pytest tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_global_config.py -q → 383 passed.
  • Adversarial review (four lenses, two independent refuters per finding, each reproduced against the code): the two surviving findings attributable to this PR are fixed in the second commit.
  • New tests in TestEnvironmentServerRouting: a mixed batch dispatches the native row to its taskset's route as an episode request and the flat row to the server fronting its agent as today's flat body; a materialized row without a route fails before dispatch; legacy mode stamps flat rows with environment_server_name and materialized rows by taskset, then dispatches both through run_examples against a legacy_agent server that binds no resources server; num_repeats_add_seed on a materialized row fails before dispatch; taskset mode still rejects flat rows.
  • ruff check and ruff format --check pass.

Compatibility and benchmark impact

Default behavior for flat-only batches is unchanged. Materialized rows in agent mode previously had no route and could not be dispatched; they now require environment_server_routes, which is what taskset mode already required.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-10-rollout-routing branch 3 times, most recently from 6609cf3 to cda783e Compare September 22, 2026 13:40
@adil-a
adil-a force-pushed the adasif/mixed-taskset-routing branch 2 times, most recently from 041a8de to abd7bee Compare September 22, 2026 14:49
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-10-rollout-routing branch 9 times, most recently from a22e9d1 to 30d46f8 Compare September 22, 2026 17:37
@adil-a
adil-a force-pushed the adasif/mixed-taskset-routing branch from abd7bee to f500f77 Compare September 23, 2026 16:22
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-10-rollout-routing branch 7 times, most recently from 934c327 to 4740b5b Compare September 23, 2026 17:48
adil-a and others added 2 commits September 23, 2026 12:42
…ts per row

Materialized tasks (`task_id.taskset` plus `task_input`) now route by
`environment_server_routes` in every `environment_routing_mode`, while flat
rows keep following the mode: `agent` resolves each row's own environment
server at dispatch, `legacy` sends every flat row to `environment_server_name`,
and `taskset` stays native-only and rejects flat rows.

One batch can therefore mix native and compatibility-routed tasksets without a
new agent x resources pairing: the native rows go to the environment server
their taskset names, the flat rows go to the `legacy_agent` server that fronts
their agent. The chosen server is stamped as `_ng_environment_server` at
preprocessing and travels with the row through the materialized input file,
resume retries and results, as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
…s and cover legacy dispatch

A materialized row keeps its prompt under task_input, so num_repeats_add_seed
cannot inject a seed; it now fails with an actionable ValueError instead of a
KeyError. A materialized row whose taskset has no route fails at preprocessing
with the missing route named. The legacy-mode test now runs through dispatch.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
@adil-a
adil-a force-pushed the adasif/mixed-taskset-routing branch from f500f77 to e30af22 Compare September 23, 2026 19:43
@adil-a
adil-a marked this pull request as ready for review September 23, 2026 20:15
@ananthsub
ananthsub merged commit bccb85c into ananthsub/episode-orchestration-10-rollout-routing Sep 23, 2026
7 checks passed
@ananthsub
ananthsub deleted the adasif/mixed-taskset-routing branch September 23, 2026 20:17
ananthsub pushed a commit that referenced this pull request Sep 28, 2026
…ts per row (#3576)

## What does this PR do?

Lets one rollout-collection batch mix native (materialized) tasksets and
compatibility-routed flat rows, with no new agent × resources pairing,
and keeps the chosen environment server's identity on every row through
shards, retries and results.

- A materialized task (`task_id.taskset` plus `task_input`) now routes
by `environment_server_routes` in **every** `environment_routing_mode`;
it is the native episode request and no agent-server `/run` accepts it.
- A flat row keeps following the mode: `agent` (default) resolves the
row's own environment server at dispatch, as today; `legacy` sends every
flat row to `environment_server_name`; `taskset` stays native-only and
rejects flat rows, so a native run cannot silently pick up legacy input.
- A materialized row whose taskset has no entry in
`environment_server_routes` fails at preprocessing with the missing
route named. (#3491 no longer has a `tasksets` config block, so routes
are the only declaration.)
- Two knobs that cannot apply to a materialized row now fail with the
fix named instead of a `KeyError`: `num_repeats_add_seed` (the seed
lives in the top-level prompt, which a materialized row keeps under
`task_input`).
- No config or YAML changes: routes point at existing environment-server
deployments, and flat rows reach the `legacy_agent` servers that #3490
generates in front of each existing pairing.

The `_ng_environment_server` stamp, written once at preprocessing,
already reaches the materialized input file, resume retries
(`_load_from_cache` re-reads the stamped rows) and result rows; this PR
does not change that path.

## Interaction flow

```mermaid
sequenceDiagram
    participant C as Rollout collector
    participant N as Native environment server, one per taskset route
    participant L as legacy_agent environment server, one per pairing
    participant A as Agent server

    Note over C: preprocess stamps _ng_environment_server once per row
    Note over C: materialized row routes by task_id.taskset, flat row follows the routing mode
    C->>N: POST /run with the episode request, episode_id plus task
    C->>L: POST /run with today's flat row
    L->>A: relay /run
    N-->>C: SingleAgentEpisodeResponse
    L-->>C: legacy result
```

## Stack position

Stacks on #3491 (part 12,
`ananthsub/episode-orchestration-10-rollout-routing`) and touches only
`nemo_gym/rollout_collection.py`, which #3492 does not modify. It can be
squashed into #3491 if preferred, since it changes the semantics of the
routing mode that PR introduces.

Follow-up (separate PR): aggregate metrics grouped by
`_ng_environment_server` instead of `agent_ref.name`, and native
`failure` replies written to the failures sidecar, so identity also
persists through `gym eval aggregate` and retries of native episodes.

## Validation

- `pytest tests/unit_tests/test_rollout_collection.py
tests/unit_tests/test_global_config.py -q` → 383 passed.
- Adversarial review (four lenses, two independent refuters per finding,
each reproduced against the code): the two surviving findings
attributable to this PR are fixed in the second commit.
- New tests in `TestEnvironmentServerRouting`: a mixed batch dispatches
the native row to its taskset's route as an episode request and the flat
row to the server fronting its agent as today's flat body; a
materialized row without a route fails before dispatch; `legacy` mode
stamps flat rows with `environment_server_name` and materialized rows by
taskset, then dispatches both through `run_examples` against a
`legacy_agent` server that binds no resources server;
`num_repeats_add_seed` on a materialized row fails before dispatch;
`taskset` mode still rejects flat rows.
- `ruff check` and `ruff format --check` pass.

## Compatibility and benchmark impact

Default behavior for flat-only batches is unchanged. Materialized rows
in `agent` mode previously had no route and could not be dispatched;
they now require `environment_server_routes`, which is what `taskset`
mode already required.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Adil Asif <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
yaoyu-33 pushed a commit to yaoyu-33/Gym that referenced this pull request Sep 29, 2026
…ts per row (NVIDIA-NeMo#3576)

## What does this PR do?

Lets one rollout-collection batch mix native (materialized) tasksets and
compatibility-routed flat rows, with no new agent × resources pairing,
and keeps the chosen environment server's identity on every row through
shards, retries and results.

- A materialized task (`task_id.taskset` plus `task_input`) now routes
by `environment_server_routes` in **every** `environment_routing_mode`;
it is the native episode request and no agent-server `/run` accepts it.
- A flat row keeps following the mode: `agent` (default) resolves the
row's own environment server at dispatch, as today; `legacy` sends every
flat row to `environment_server_name`; `taskset` stays native-only and
rejects flat rows, so a native run cannot silently pick up legacy input.
- A materialized row whose taskset has no entry in
`environment_server_routes` fails at preprocessing with the missing
route named. (NVIDIA-NeMo#3491 no longer has a `tasksets` config block, so routes
are the only declaration.)
- Two knobs that cannot apply to a materialized row now fail with the
fix named instead of a `KeyError`: `num_repeats_add_seed` (the seed
lives in the top-level prompt, which a materialized row keeps under
`task_input`).
- No config or YAML changes: routes point at existing environment-server
deployments, and flat rows reach the `legacy_agent` servers that NVIDIA-NeMo#3490
generates in front of each existing pairing.

The `_ng_environment_server` stamp, written once at preprocessing,
already reaches the materialized input file, resume retries
(`_load_from_cache` re-reads the stamped rows) and result rows; this PR
does not change that path.

## Interaction flow

```mermaid
sequenceDiagram
    participant C as Rollout collector
    participant N as Native environment server, one per taskset route
    participant L as legacy_agent environment server, one per pairing
    participant A as Agent server

    Note over C: preprocess stamps _ng_environment_server once per row
    Note over C: materialized row routes by task_id.taskset, flat row follows the routing mode
    C->>N: POST /run with the episode request, episode_id plus task
    C->>L: POST /run with today's flat row
    L->>A: relay /run
    N-->>C: SingleAgentEpisodeResponse
    L-->>C: legacy result
```

## Stack position

Stacks on NVIDIA-NeMo#3491 (part 12,
`ananthsub/episode-orchestration-10-rollout-routing`) and touches only
`nemo_gym/rollout_collection.py`, which NVIDIA-NeMo#3492 does not modify. It can be
squashed into NVIDIA-NeMo#3491 if preferred, since it changes the semantics of the
routing mode that PR introduces.

Follow-up (separate PR): aggregate metrics grouped by
`_ng_environment_server` instead of `agent_ref.name`, and native
`failure` replies written to the failures sidecar, so identity also
persists through `gym eval aggregate` and retries of native episodes.

## Validation

- `pytest tests/unit_tests/test_rollout_collection.py
tests/unit_tests/test_global_config.py -q` → 383 passed.
- Adversarial review (four lenses, two independent refuters per finding,
each reproduced against the code): the two surviving findings
attributable to this PR are fixed in the second commit.
- New tests in `TestEnvironmentServerRouting`: a mixed batch dispatches
the native row to its taskset's route as an episode request and the flat
row to the server fronting its agent as today's flat body; a
materialized row without a route fails before dispatch; `legacy` mode
stamps flat rows with `environment_server_name` and materialized rows by
taskset, then dispatches both through `run_examples` against a
`legacy_agent` server that binds no resources server;
`num_repeats_add_seed` on a materialized row fails before dispatch;
`taskset` mode still rejects flat rows.
- `ruff check` and `ruff format --check` pass.

## Compatibility and benchmark impact

Default behavior for flat-only batches is unchanged. Materialized rows
in `agent` mode previously had no route and could not be dispatched;
they now require `environment_server_routes`, which is what `taskset`
mode already required.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Adil Asif <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
ananthsub pushed a commit that referenced this pull request Sep 29, 2026
…ts per row (#3576)

## What does this PR do?

Lets one rollout-collection batch mix native (materialized) tasksets and
compatibility-routed flat rows, with no new agent × resources pairing,
and keeps the chosen environment server's identity on every row through
shards, retries and results.

- A materialized task (`task_id.taskset` plus `task_input`) now routes
by `environment_server_routes` in **every** `environment_routing_mode`;
it is the native episode request and no agent-server `/run` accepts it.
- A flat row keeps following the mode: `agent` (default) resolves the
row's own environment server at dispatch, as today; `legacy` sends every
flat row to `environment_server_name`; `taskset` stays native-only and
rejects flat rows, so a native run cannot silently pick up legacy input.
- A materialized row whose taskset has no entry in
`environment_server_routes` fails at preprocessing with the missing
route named. (#3491 no longer has a `tasksets` config block, so routes
are the only declaration.)
- Two knobs that cannot apply to a materialized row now fail with the
fix named instead of a `KeyError`: `num_repeats_add_seed` (the seed
lives in the top-level prompt, which a materialized row keeps under
`task_input`).
- No config or YAML changes: routes point at existing environment-server
deployments, and flat rows reach the `legacy_agent` servers that #3490
generates in front of each existing pairing.

The `_ng_environment_server` stamp, written once at preprocessing,
already reaches the materialized input file, resume retries
(`_load_from_cache` re-reads the stamped rows) and result rows; this PR
does not change that path.

## Interaction flow

```mermaid
sequenceDiagram
    participant C as Rollout collector
    participant N as Native environment server, one per taskset route
    participant L as legacy_agent environment server, one per pairing
    participant A as Agent server

    Note over C: preprocess stamps _ng_environment_server once per row
    Note over C: materialized row routes by task_id.taskset, flat row follows the routing mode
    C->>N: POST /run with the episode request, episode_id plus task
    C->>L: POST /run with today's flat row
    L->>A: relay /run
    N-->>C: SingleAgentEpisodeResponse
    L-->>C: legacy result
```

## Stack position

Stacks on #3491 (part 12,
`ananthsub/episode-orchestration-10-rollout-routing`) and touches only
`nemo_gym/rollout_collection.py`, which #3492 does not modify. It can be
squashed into #3491 if preferred, since it changes the semantics of the
routing mode that PR introduces.

Follow-up (separate PR): aggregate metrics grouped by
`_ng_environment_server` instead of `agent_ref.name`, and native
`failure` replies written to the failures sidecar, so identity also
persists through `gym eval aggregate` and retries of native episodes.

## Validation

- `pytest tests/unit_tests/test_rollout_collection.py
tests/unit_tests/test_global_config.py -q` → 383 passed.
- Adversarial review (four lenses, two independent refuters per finding,
each reproduced against the code): the two surviving findings
attributable to this PR are fixed in the second commit.
- New tests in `TestEnvironmentServerRouting`: a mixed batch dispatches
the native row to its taskset's route as an episode request and the flat
row to the server fronting its agent as today's flat body; a
materialized row without a route fails before dispatch; `legacy` mode
stamps flat rows with `environment_server_name` and materialized rows by
taskset, then dispatches both through `run_examples` against a
`legacy_agent` server that binds no resources server;
`num_repeats_add_seed` on a materialized row fails before dispatch;
`taskset` mode still rejects flat rows.
- `ruff check` and `ruff format --check` pass.

## Compatibility and benchmark impact

Default behavior for flat-only batches is unchanged. Materialized rows
in `agent` mode previously had no route and could not be dispatched;
they now require `environment_server_routes`, which is what `taskset`
mode already required.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Adil Asif <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
ananthsub pushed a commit that referenced this pull request Sep 29, 2026
…ts per row (#3576)

## What does this PR do?

Lets one rollout-collection batch mix native (materialized) tasksets and
compatibility-routed flat rows, with no new agent × resources pairing,
and keeps the chosen environment server's identity on every row through
shards, retries and results.

- A materialized task (`task_id.taskset` plus `task_input`) now routes
by `environment_server_routes` in **every** `environment_routing_mode`;
it is the native episode request and no agent-server `/run` accepts it.
- A flat row keeps following the mode: `agent` (default) resolves the
row's own environment server at dispatch, as today; `legacy` sends every
flat row to `environment_server_name`; `taskset` stays native-only and
rejects flat rows, so a native run cannot silently pick up legacy input.
- A materialized row whose taskset has no entry in
`environment_server_routes` fails at preprocessing with the missing
route named. (#3491 no longer has a `tasksets` config block, so routes
are the only declaration.)
- Two knobs that cannot apply to a materialized row now fail with the
fix named instead of a `KeyError`: `num_repeats_add_seed` (the seed
lives in the top-level prompt, which a materialized row keeps under
`task_input`).
- No config or YAML changes: routes point at existing environment-server
deployments, and flat rows reach the `legacy_agent` servers that #3490
generates in front of each existing pairing.

The `_ng_environment_server` stamp, written once at preprocessing,
already reaches the materialized input file, resume retries
(`_load_from_cache` re-reads the stamped rows) and result rows; this PR
does not change that path.

## Interaction flow

```mermaid
sequenceDiagram
    participant C as Rollout collector
    participant N as Native environment server, one per taskset route
    participant L as legacy_agent environment server, one per pairing
    participant A as Agent server

    Note over C: preprocess stamps _ng_environment_server once per row
    Note over C: materialized row routes by task_id.taskset, flat row follows the routing mode
    C->>N: POST /run with the episode request, episode_id plus task
    C->>L: POST /run with today's flat row
    L->>A: relay /run
    N-->>C: SingleAgentEpisodeResponse
    L-->>C: legacy result
```

## Stack position

Stacks on #3491 (part 12,
`ananthsub/episode-orchestration-10-rollout-routing`) and touches only
`nemo_gym/rollout_collection.py`, which #3492 does not modify. It can be
squashed into #3491 if preferred, since it changes the semantics of the
routing mode that PR introduces.

Follow-up (separate PR): aggregate metrics grouped by
`_ng_environment_server` instead of `agent_ref.name`, and native
`failure` replies written to the failures sidecar, so identity also
persists through `gym eval aggregate` and retries of native episodes.

## Validation

- `pytest tests/unit_tests/test_rollout_collection.py
tests/unit_tests/test_global_config.py -q` → 383 passed.
- Adversarial review (four lenses, two independent refuters per finding,
each reproduced against the code): the two surviving findings
attributable to this PR are fixed in the second commit.
- New tests in `TestEnvironmentServerRouting`: a mixed batch dispatches
the native row to its taskset's route as an episode request and the flat
row to the server fronting its agent as today's flat body; a
materialized row without a route fails before dispatch; `legacy` mode
stamps flat rows with `environment_server_name` and materialized rows by
taskset, then dispatches both through `run_examples` against a
`legacy_agent` server that binds no resources server;
`num_repeats_add_seed` on a materialized row fails before dispatch;
`taskset` mode still rejects flat rows.
- `ruff check` and `ruff format --check` pass.

## Compatibility and benchmark impact

Default behavior for flat-only batches is unchanged. Materialized rows
in `agent` mode previously had no route and could not be dispatched;
they now require `environment_server_routes`, which is what `taskset`
mode already required.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Adil Asif <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
yaoyu-33 pushed a commit to yaoyu-33/Gym that referenced this pull request Oct 3, 2026
…ts per row (NVIDIA-NeMo#3576)

## What does this PR do?

Lets one rollout-collection batch mix native (materialized) tasksets and
compatibility-routed flat rows, with no new agent × resources pairing,
and keeps the chosen environment server's identity on every row through
shards, retries and results.

- A materialized task (`task_id.taskset` plus `task_input`) now routes
by `environment_server_routes` in **every** `environment_routing_mode`;
it is the native episode request and no agent-server `/run` accepts it.
- A flat row keeps following the mode: `agent` (default) resolves the
row's own environment server at dispatch, as today; `legacy` sends every
flat row to `environment_server_name`; `taskset` stays native-only and
rejects flat rows, so a native run cannot silently pick up legacy input.
- A materialized row whose taskset has no entry in
`environment_server_routes` fails at preprocessing with the missing
route named. (NVIDIA-NeMo#3491 no longer has a `tasksets` config block, so routes
are the only declaration.)
- Two knobs that cannot apply to a materialized row now fail with the
fix named instead of a `KeyError`: `num_repeats_add_seed` (the seed
lives in the top-level prompt, which a materialized row keeps under
`task_input`).
- No config or YAML changes: routes point at existing environment-server
deployments, and flat rows reach the `legacy_agent` servers that NVIDIA-NeMo#3490
generates in front of each existing pairing.

The `_ng_environment_server` stamp, written once at preprocessing,
already reaches the materialized input file, resume retries
(`_load_from_cache` re-reads the stamped rows) and result rows; this PR
does not change that path.

## Interaction flow

```mermaid
sequenceDiagram
    participant C as Rollout collector
    participant N as Native environment server, one per taskset route
    participant L as legacy_agent environment server, one per pairing
    participant A as Agent server

    Note over C: preprocess stamps _ng_environment_server once per row
    Note over C: materialized row routes by task_id.taskset, flat row follows the routing mode
    C->>N: POST /run with the episode request, episode_id plus task
    C->>L: POST /run with today's flat row
    L->>A: relay /run
    N-->>C: SingleAgentEpisodeResponse
    L-->>C: legacy result
```

## Stack position

Stacks on NVIDIA-NeMo#3491 (part 12,
`ananthsub/episode-orchestration-10-rollout-routing`) and touches only
`nemo_gym/rollout_collection.py`, which NVIDIA-NeMo#3492 does not modify. It can be
squashed into NVIDIA-NeMo#3491 if preferred, since it changes the semantics of the
routing mode that PR introduces.

Follow-up (separate PR): aggregate metrics grouped by
`_ng_environment_server` instead of `agent_ref.name`, and native
`failure` replies written to the failures sidecar, so identity also
persists through `gym eval aggregate` and retries of native episodes.

## Validation

- `pytest tests/unit_tests/test_rollout_collection.py
tests/unit_tests/test_global_config.py -q` → 383 passed.
- Adversarial review (four lenses, two independent refuters per finding,
each reproduced against the code): the two surviving findings
attributable to this PR are fixed in the second commit.
- New tests in `TestEnvironmentServerRouting`: a mixed batch dispatches
the native row to its taskset's route as an episode request and the flat
row to the server fronting its agent as today's flat body; a
materialized row without a route fails before dispatch; `legacy` mode
stamps flat rows with `environment_server_name` and materialized rows by
taskset, then dispatches both through `run_examples` against a
`legacy_agent` server that binds no resources server;
`num_repeats_add_seed` on a materialized row fails before dispatch;
`taskset` mode still rejects flat rows.
- `ruff check` and `ruff format --check` pass.

## Compatibility and benchmark impact

Default behavior for flat-only batches is unchanged. Materialized rows
in `agent` mode previously had no route and could not be dispatched;
they now require `environment_server_routes`, which is what `taskset`
mode already required.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Adil Asif <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants