Repository navigation
feat: add --agent-type CLI flag to enable agent swaping - #2641
Conversation
aaeacda to
12c1af6
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. |
12c1af6 to
aaeacda
Compare
aaeacda to
7ae0b46
Compare
dff1bff to
1ee85dc
Compare
96fc1e5 to
cb7ee33
Compare
|
/claude review |
|
SHIP — config plumbing refactor, no reliability concerns. Reviewed the whole diff (32 files). This renames four agent configs to match their dirs, extracts standalone agent configs pulled in via
NOTE (author's call, non-blocking): Could not execute pytest in this sandbox, but the merge/inherit semantics and updated test wiring check out by inspection. |
|
@cmunley1 it was reviewed by a bot already, I wouldn't waste your time if it wasn't |
|
Here is some additional comments from Claude review, could you take a look? If they are incorrect, no worries.
In serve mode this switches Silent wrong config.
Hard error.
Could serve mode fall back to
This covers the Worth a companion case here asserting whatever serve mode should do with a non-config name.
These two removed cases were the only assertions that
nit: |
gwarmstrong
left a comment
There was a problem hiding this comment.
A couple nits but otherwise lgtm
| translate_to_hydra=lambda args: ( | ||
| [] | ||
| if not args.agent | ||
| else [f"+agent_name={args.agent}"] | ||
| if args.no_serve | ||
| else [f"+config_paths=[{_asset_config_path('agent', args.agent)}]"] | ||
| ), |
There was a problem hiding this comment.
The --agent flag can give different results here depending on the --no_serve flag, which could be confusing end user behavior:
$ gym eval run --benchmark gpqa --model-type vllm_model --agent gpqa_mcqa_simple_agent -o out.jsonl
gym eval run: error: `--agent gpqa_mcqa_simple_agent` was specified which implies config
`responses_api_agents/gpqa_mcqa_simple_agent/configs/gpqa_mcqa_simple_agent.yaml`, which does not
exist. Did you mean `simple_agent`?
$ gym eval run --no-serve --agent gpqa_mcqa_simple_agent -i rows.jsonl -o out.jsonl
Using `gpqa_mcqa_simple_agent` for rows that do not already have an agent ref
There was a problem hiding this comment.
+1, --agent is doing double duty in determining both where this row should go in choosing a running agent instance, and also which harness does that instance run.
would splitting this into 2 flags make the intent clearer? e.g. --agent-instance and --agent-implementation?
gym eval run \
--environment math \
--agent-instance math_agent \
--agent-implementation hermes_agent
- Load the environment’s math_agent instance.
- Replace only its harness with Hermes.
- Keep its resources-server and model bindings.
- Route the selected rows to math_agent.
and with existing servers,
gym eval run --no-serve --agent-instance math_agent
routes rows to the running math_agent. adding --agent-implementation with --no-serve should fail since the server is already running
There was a problem hiding this comment.
fair point. I will go with --agent-instance and --agent-type to be consistent with --model-type
There was a problem hiding this comment.
Actually there's no need to touch old --agent flag. I'll revert this change and just add a new --agent-type flag for the new functionality
| RESOURCES_SERVER_CONFIG = _asset_selector("resources-server") | ||
| MODEL_TYPE = _asset_selector("model-type") | ||
|
|
||
| AGENT = _asset_selector("agent") |
There was a problem hiding this comment.
_asset_selector() registers only the long form, while EVAL_RUN_AGENT below allows both --agent and -a, so the short form only works on some commands, e.g.,
$ gym eval run -a hermes_agent ... # accepted
$ gym env start -a hermes_agent ...
gym env start: error: unrecognized arguments: -a
There was a problem hiding this comment.
should we keep -a for agent instance or use it for agent type? I split the flag per the other comment. Or introduce two aliases?
There was a problem hiding this comment.
I'll keep is backward compatible: -a stays with --agent and --agent-type don't get an alias, at least for now. I couldn't come up with any alias that wouldn't be confusing. We can add it later if anyone has a good idea which latter we should use 😅
The merge-base changed after approval.
55514ee to
19af282
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]>
19af282 to
a5ffcb4
Compare
Main's #2641 compose test asserts the composed agent block carries the gpqa benchmark dataset; the migration moved it to the resources server. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
Main's #2641 compose test asserts the composed agent block carries the gpqa benchmark dataset; the migration moved it to the resources server. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
Main's #2641 compose test asserts the composed agent block carries the gpqa benchmark dataset; the migration moved it to the resources server. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
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:
--agent-typeflag in the CLI for selecting the agent (this PR)