Repository navigation
feat: allow to swap agents when parsing the config - #2640
Conversation
a4d2620 to
6f6b3bb
Compare
|
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. |
4986829 to
c382d80
Compare
fb1d0ce to
48dd5c5
Compare
| self._carry_over_agent_bindings(target.server_config, composed) | ||
| # Instance names are kept: `agent_ref` is baked into prepared data, so renaming breaks collection. | ||
| agents = global_config_dict[target.name][AGENT_SERVER_TYPE_KEY_NAME] | ||
| agents.pop(target.agent_type) |
There was a problem hiding this comment.
does this silently discard every key outside the three carry-over keys, including CLI overrides, so ++...simple_agent.max_turns=99 still composes to max_turns: 30, inverting the precedence get_global_config_dict's docstring documents?
There was a problem hiding this comment.
to fix, this PR needs to apply CLI overrides to the final composed configuration
There was a problem hiding this comment.
oh right, this was not intended. good catch, thank you!
| _AgentInstance( | ||
| name=str(name), | ||
| agent_type=agent_type, | ||
| server_config=agents[agent_type], |
There was a problem hiding this comment.
for a config with an unset inner agent block:
broken:
responses_api_agents:
simple_agent: ???Before this pass, the normal missing-value check raises ConfigMissingValuesError.
_agent_instances() now evaluates agents[agent_type] first, so OmegaConf raises MissingMandatoryValue here instead. The CLI catches ConfigError, not that OmegaConf exception, and exposes a traceback
| def _carry_over_agent_bindings(original: DictConfig, composed: DictConfig) -> None: | ||
| """Move the environment's bindings onto the composed agent config, in place.""" | ||
| for key in _COMPOSED_AGENT_CARRY_OVER_KEYS: | ||
| if key in original: |
There was a problem hiding this comment.
for a config that leaves its model binding unset:
target:
responses_api_agents:
simple_agent:
model_server: ???OmegaConf reports a whole-value ??? as absent, so this loop does not carry the missing value into the composed agent.
If the standalone source has model_server: policy_model, parsing silently succeeds with policy_model.
otherwise if the source has no model binding, the target’s model_server field disappears.
we need to distinguish between an absent key from an explicitly missing value
| ) | ||
|
|
||
| source = sources[0] | ||
| targets = [instance for instance in instances if instance.name != source.name] |
There was a problem hiding this comment.
in this example:
config_paths:
- benchmarks/nemotron_3.5_super/eval_container_config.yaml
- responses_api_agents/hermes_agent/configs/hermes_agent.yamlthe config contains ordinary agents with resources servers bound and two self-contained Tau2 agents.
The Tau2 agents intentionally have no resources_server; after they are replaced with Hermes, there is no target binding to copy over, so parsing fails:
ConfigMissingValuesError:
- tau2_banking_knowledge_bm25_grep_artificial_analysis_agent.responses_api_agents.hermes_agent.resources_server.name
- tau2_benchmark_agent.responses_api_agents.hermes_agent.resources_server.name
self-contained agents should be unchanged. only agents with concrete resources server bindings should compose
94c43bb
0a8fa57 to
af4ac6e
Compare
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
af4ac6e to
fdbdc14
Compare
This PR introduces possibility to swap agents in your experiment during runtime, without a need to create a dedicated config. It builds on top of #2640 and passes a selected agent's config to the config composition machinery. The entire PR stack will introduce the following changes: 1. config composition 2. `--agent-type` flag in the CLI for selecting the agent (**this PR**) 3. safeguard preventing unsupported env <> agent pairings 4. aligning with dataset changes introduced in epic #1338 5. docs update --------- Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
This PR introduces possibility to compose a new config at runtime by combining a benchmark / env config with an agent config template.
The mechanism is based on finding an agent config with undefined resources server:
and filling the missing part with information from resources server configuration available in the global config.
The entire PR stack will introduce the following changes:
--agent-typeflag in the CLI for selecting the agent