Skip to content

feat: Rollout infra upgrades - #761

Merged
bxyu-nvidia merged 109 commits into
mainfrom
bxyu/rc-infra-no-modelconfigs
Feb 25, 2026
Merged

bxyu-nvidia merged 109 commits into
mainfrom
bxyu/rc-infra-no-modelconfigs

Conversation

@bxyu-nvidia

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
Signed-off-by: Brian Yu <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Feb 25, 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.

Signed-off-by: Brian Yu <[email protected]>
@bxyu-nvidia
bxyu-nvidia marked this pull request as ready for review February 25, 2026 18:25
@bxyu-nvidia
bxyu-nvidia requested a review from a team as a code owner February 25, 2026 18:25
@bxyu-nvidia
bxyu-nvidia merged commit c45ee6a into main Feb 25, 2026
5 checks passed
@bxyu-nvidia
bxyu-nvidia deleted the bxyu/rc-infra-no-modelconfigs branch February 25, 2026 19:26
abubakaria56 pushed a commit to abubakaria56/Gym that referenced this pull request Mar 2, 2026
abubakaria56 pushed a commit to abubakaria56/Gym that referenced this pull request Mar 2, 2026
marta-sd pushed a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
marta-sd pushed a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
adil-a added a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
adil-a added a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
adil-a added a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
adil-a added a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
adil-a added a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
adil-a added a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
adil-a added a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
adil-a added a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
kajalj22 pushed a commit that referenced this pull request Aug 26, 2026
Two changes to how rows are routed to agents at collection time:

1. agent_map: explicit per-agent re-routing, keyed by the agent_ref.name in
   the data, with a _default entry applying to unmatched rows (including rows
   with no agent_ref). Precedence: agent_map[<row value>] > agent_map._default
   > row agent_ref. agent_name becomes sugar for agent_map={_default: ...} and
   therefore re-routes every row again, restoring the override semantics #568
   shipped and #761 silently reduced to fill-only (no test or doc pinned the
   fill-only behavior). A warning enumerates overridden values for one cycle.

2. Pre-dispatch validation: before any /run is sent, every distinct agent name
   in the rows is checked against the running config; unknown names fail with
   a did-you-mean error instead of a raw omegaconf ConfigKeyError thrown
   mid-collection after valid rows were already dispatched.

New contract tests pin the precedence rules so future semantic changes cannot
land silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
kajalj22 added a commit that referenced this pull request Aug 26, 2026
)

## Problem

Dataset rows carry `agent_ref` (the agent that runs them), stamped at
data prep. Two problems today:

1. **You cannot re-route a stamped dataset.** `--agent` only fills rows
that have no `agent_ref`. It never overrides one. To run the same data
with a different agent, you must regenerate the dataset.
2. **A stale `agent_ref` crashes mid-run.** If a row names an agent not
in the running config, dispatch throws a raw `ConfigKeyError` after
earlier rows were already sent. 7 committed datasets in this repo hit
this today.

## Change

**1. New `agent_map` config: explicit re-routing.**

```bash
# Before: train.jsonl stamped with agent A. To run it with agent B: regenerate the dataset.
# After:
gym eval run --no-serve -i train.jsonl '+agent_map={agent_a: agent_b}'
```

`agent_map` is a lookup table: "when a row says *this* agent, send it to
*that* agent instead." Keys are `agent_ref.name` values found in the
data. The reserved key `_default` is a catch-all: it matches every row
that has no specific entry, including rows with no `agent_ref` at all.

Per row, first hit wins:
1. `agent_map[<row's agent_ref.name>]` → use it
2. `agent_map._default` → use it
3. row's own `agent_ref` → use it (no `agent_ref` either → hard error,
same as today)

Worked example — input rows carry `agent_a`, `agent_b`, and (none):

| You pass | `agent_a` row | `agent_b` row | no-ref row |
|---|---|---|---|
| *(nothing)* | agent_a | agent_b | error |
| `+agent_map={agent_a: agent_x}` | **agent_x** | agent_b | error |
| `+agent_map={agent_a: agent_x, _default: agent_y}` | **agent_x** |
**agent_y** | **agent_y** |
| `--agent agent_z` | **agent_z** | **agent_z** | **agent_z** |

**2. `--agent X` now means `agent_map={_default: X}`: it routes every
row to X.**

```bash
# Before: --agent B only affected rows missing agent_ref; stamped rows kept their agent silently.
# After:  --agent B routes ALL rows to B. A warning lists any values it overrode.
```

This restores the semantics #568 shipped. #761 changed it to fill-only
with no test, no doc, and no mention in the commit message. No existing
test pins fill-only.

**3. Agent names are validated before dispatch.**

```text
# Before: first bad row → raw omegaconf ConfigKeyError mid-collection, partial output on disk.
# After, before any request is sent:
ValueError: Rows reference agents not present in the running config:
'math_with_judge_simple_agnet' (did you mean 'math_with_judge_simple_agent'?).
Include the agent's config in the run, or re-route with +agent_map/+agent_name.
```

## What does NOT change

- Rows with no `agent_ref` and no `--agent`: same hard error as before.
- Runs that never pass `--agent`/`agent_map`: identical routing.
Verified by replaying rollout preprocessing + dispatch for all 220
runnable config closures in the repo: 165 healthy inputs are
byte-identical; the only diffs are the 7 stale-`agent_ref` datasets now
failing pre-dispatch instead of mid-run.

## Tests

98 passed. New contract tests pin the precedence order and the
validation errors, so the semantics cannot flip silently again.

## Context

Bottom PR of the dataset↔agent decoupling stack (RFC:
gym-dataset-preparation, Open Question 1). Later PRs move routing out of
dataset rows entirely; this PR makes today's stamped datasets
re-routable and makes routing failures loud.

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

---------

Signed-off-by: Adil Asif <[email protected]>
Co-authored-by: Claude Fable 5 <[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.

1 participant