Repository navigation
feat: add safeguard for agent - resources server compatibility - #2661
Conversation
477d167 to
d364509
Compare
d364509 to
8fd8465
Compare
| browsecomp_benchmark_resources_server: | ||
| resources_servers: | ||
| browsecomp_advanced_harness: | ||
| requires_agent: [browsecomp_agent] |
There was a problem hiding this comment.
Should there be an unallowed_agents list ?
For example, gymnasium_agent wont work with anyswe_agent, afaik
There was a problem hiding this comment.
maybe this should also be allowed_agents (plural?)
There was a problem hiding this comment.
allowed_agents works 👍 regarding unallowed agents: I think it's redundant, unallowed == everything minus allowed ones (tho the list can get big)
| self, global_config_dict: DictConfig, source: _AgentInstance, targets: List[_AgentInstance] | ||
| ) -> None: | ||
| """Reject swapping `source` onto any target whose resources server does not declare support for it. | ||
|
|
There was a problem hiding this comment.
Consider this routed row and configuration:
source_rs:
resources_servers:
source:
requires_agent: [source_impl]
runtime_agent:
responses_api_agents:
other_impl:
resources_server:
name: other_rs
agent_map:
source_rs: runtime_agentThe row starts with task_source: source_rs. Runtime preprocessing changes its destination to runtime_agent, but this compatibility check is not called because no unbound implementation is being composed. Name validation succeeds and /run is dispatched.
The reproduced request sequence was:
live rollout /verify -> other_rs
reverify /verify -> source_rs
The live agent follows its configured other_rs binding, while reverification treats the row’s task_source as authoritative. agent_map, _default/no-serve routing, and fan_out all bypassed requires_agent; the fan-out case dispatched both the compatible and incompatible agents
| if not isinstance(servers, DictConfig) or len(servers) != 1: | ||
| return None | ||
| implementation = next(iter(servers)) | ||
| declared = servers[implementation].get(REQUIRES_AGENT_KEY_NAME) |
There was a problem hiding this comment.
for a scalar command-line override instead of a YAML list:
++server.resources_servers.impl.requires_agent=hermes_agentthe configuration model does not declare a type for requires_agent, and composition runs before server-model validation. This code therefore iterates the string and interprets it as:
[h, e, r, m, e, s, _, a, g, e, n, t]
The valid hermes_agent pairing is then rejected
There was a problem hiding this comment.
I added support for strings (I think it's very common use-case) and better errors for incorrect inputs in 606ba1f
| f"and accepts {', '.join(required)}" | ||
| for target, required in rejected | ||
| ) | ||
| supported = sorted(set.intersection(*(set(required) for _, required in rejected))) |
There was a problem hiding this comment.
for these two valid target instances:
target_a:
requires_agent: [hermes_agent]
target_b:
requires_agent: [simple_agent]When Hermes is selected, only target_b is added to rejected. The intersection below therefore contains simple_agent, and the error says:
Select one of: simple_agent.
Selecting simple_agent does not solve the configuration; target_a then rejects it.
should we get the recommendation from every restrictive target, not just the targets that reject the current selection?
The merge-base changed after approval.
8fd8465 to
ae94ce8
Compare
b6f3d37 to
9e0026b
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]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
…lout collection Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
9e0026b to
9170da1
Compare
While working on #2661 Several configs that require `allowed_agents` to be specified were added later on. This PR updates them as well as agent configs associated with them. --------- Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
While working on #2661 Several configs that require `allowed_agents` to be specified were added later on. This PR updates them as well as agent configs associated with them. --------- Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]> Signed-off-by: Junkeun Yi <[email protected]>
This PR introduces a safeguard preventing users from accidentally swapping agent with an unsupported one.
The entire PR stack will introduce the following changes:
--agent-typeflag in the CLI for selecting the agent