Repository navigation
feat(rollout): agent_map override + pre-dispatch agent validation - #2710
Conversation
cc59042 to
31518cb
Compare
| after valid rows have already been dispatched. | ||
| """ | ||
| requested = {name for row in examples if (name := (row.get(AGENT_REF_KEY_NAME) or {}).get("name")) is not None} | ||
| available = set(global_config_dict.keys()) |
There was a problem hiding this comment.
This treats every top-level config key as a valid agent. An agent_map target naming a resources or model server passes validation, then receives a /run request that it cannot handle.
This should filter to responses_api_agents
There was a problem hiding this comment.
Fixed in 58d45a8: available now filters to instances with a responses_api_agents block, and a target that exists but is not an agent fails pre-dispatch with '<name>' (exists but is not an agent instance). Test added (agent_map target naming an RS instance). This check previously sat one PR up the stack; moved it here, where the validator is introduced.
|
/ok to test 58d45a8a4fdef043a129ef2436cbcc9be3132b6c |
@adil-a, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test 58d45a8 |
|
/ok to test 58d45a8 |
|
/ok to test 8025f00 |
58d45a8 to
8025f00
Compare
…ent override Review feedback on #2710: 1. _validate_agent_names accepted any top-level config key, so an agent_map target naming a resources or model server passed validation and then received a /run request it cannot handle. The check now filters to instances with a responses_api_agents block; naming an existing non-agent instance fails pre-dispatch with 'exists but is not an agent instance'. (This check previously landed one PR up the stack; it belongs here, where the validator is introduced.) 2. The reward-profiling quick-start still described +agent_name as fill-only ('supplies a default for rows without one'). Updated: it routes every row, overriding baked agent_ref (shorthand for +agent_map={_default: <name>}), which is this PR's restored #568 override semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Adil Asif <adasif@nvidia.com>
8025f00 to
de42916
Compare
…ent override Review feedback on #2710: 1. _validate_agent_names accepted any top-level config key, so an agent_map target naming a resources or model server passed validation and then received a /run request it cannot handle. The check now filters to instances with a responses_api_agents block; naming an existing non-agent instance fails pre-dispatch with 'exists but is not an agent instance'. (This check previously landed one PR up the stack; it belongs here, where the validator is introduced.) 2. The reward-profiling quick-start still described +agent_name as fill-only ('supplies a default for rows without one'). Updated: it routes every row, overriding baked agent_ref (shorthand for +agent_map={_default: <name>}), which is this PR's restored #568 override semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Adil Asif <adasif@nvidia.com>
de42916 to
397cc06
Compare
fa997c5 to
f08b1ae
Compare
|
/ok to test f08b1ae |
…ent override Review feedback on #2710: 1. _validate_agent_names accepted any top-level config key, so an agent_map target naming a resources or model server passed validation and then received a /run request it cannot handle. The check now filters to instances with a responses_api_agents block; naming an existing non-agent instance fails pre-dispatch with 'exists but is not an agent instance'. (This check previously landed one PR up the stack; it belongs here, where the validator is introduced.) 2. The reward-profiling quick-start still described +agent_name as fill-only ('supplies a default for rows without one'). Updated: it routes every row, overriding baked agent_ref (shorthand for +agent_map={_default: <name>}), which is this PR's restored #568 override semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Adil Asif <adasif@nvidia.com>
f08b1ae to
0c45b6b
Compare
|
/ok to test 0c45b6b |
…ent override Review feedback on #2710: 1. _validate_agent_names accepted any top-level config key, so an agent_map target naming a resources or model server passed validation and then received a /run request it cannot handle. The check now filters to instances with a responses_api_agents block; naming an existing non-agent instance fails pre-dispatch with 'exists but is not an agent instance'. (This check previously landed one PR up the stack; it belongs here, where the validator is introduced.) 2. The reward-profiling quick-start still described +agent_name as fill-only ('supplies a default for rows without one'). Updated: it routes every row, overriding baked agent_ref (shorthand for +agent_map={_default: <name>}), which is this PR's restored #568 override semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Adil Asif <adasif@nvidia.com>
0c45b6b to
10dce44
Compare
|
/ok to test 10dce44 |
…ent override Review feedback on #2710: 1. _validate_agent_names accepted any top-level config key, so an agent_map target naming a resources or model server passed validation and then received a /run request it cannot handle. The check now filters to instances with a responses_api_agents block; naming an existing non-agent instance fails pre-dispatch with 'exists but is not an agent instance'. (This check previously landed one PR up the stack; it belongs here, where the validator is introduced.) 2. The reward-profiling quick-start still described +agent_name as fill-only ('supplies a default for rows without one'). Updated: it routes every row, overriding baked agent_ref (shorthand for +agent_map={_default: <name>}), which is this PR's restored #568 override semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Adil Asif <adasif@nvidia.com>
10dce44 to
8aeeb09
Compare
|
/ok to test 8aeeb09 |
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 <noreply@anthropic.com>
Signed-off-by: Adil Asif <adasif@nvidia.com>
…g_dict Pre-dispatch agent validation reads the running config off the server client; the in-process mock lacked the attribute, failing the server suite (shard 7). Only server test that drives the collector directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Adil Asif <adasif@nvidia.com>
…ent override Review feedback on #2710: 1. _validate_agent_names accepted any top-level config key, so an agent_map target naming a resources or model server passed validation and then received a /run request it cannot handle. The check now filters to instances with a responses_api_agents block; naming an existing non-agent instance fails pre-dispatch with 'exists but is not an agent instance'. (This check previously landed one PR up the stack; it belongs here, where the validator is introduced.) 2. The reward-profiling quick-start still described +agent_name as fill-only ('supplies a default for rows without one'). Updated: it routes every row, overriding baked agent_ref (shorthand for +agent_map={_default: <name>}), which is this PR's restored #568 override semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Adil Asif <adasif@nvidia.com>
8aeeb09 to
e5fe62b
Compare
Problem
Dataset rows carry
agent_ref(the agent that runs them), stamped at data prep. Two problems today:--agentonly fills rows that have noagent_ref. It never overrides one. To run the same data with a different agent, you must regenerate the dataset.agent_refcrashes mid-run. If a row names an agent not in the running config, dispatch throws a rawConfigKeyErrorafter earlier rows were already sent. 7 committed datasets in this repo hit this today.Change
1. New
agent_mapconfig: explicit re-routing.agent_mapis a lookup table: "when a row says this agent, send it to that agent instead." Keys areagent_ref.namevalues found in the data. The reserved key_defaultis a catch-all: it matches every row that has no specific entry, including rows with noagent_refat all.Per row, first hit wins:
agent_map[<row's agent_ref.name>]→ use itagent_map._default→ use itagent_ref→ use it (noagent_refeither → hard error, same as today)Worked example — input rows carry
agent_a,agent_b, and (none):agent_arowagent_brow+agent_map={agent_a: agent_x}+agent_map={agent_a: agent_x, _default: agent_y}--agent agent_z2.
--agent Xnow meansagent_map={_default: X}: it routes every row to X.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.
What does NOT change
agent_refand no--agent: same hard error as before.--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_refdatasets 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