Repository navigation
Description
Background
Extracted from: #1434
Agent swappability is blocked at multiple levels across the codebase. Understanding all of them is necessary to scope the work correctly and decide what can be addressed together vs. tracked separately.
Group 1: Composable environments: swapping requires a new YAML file
Examples: workplace_assistant, browsecomp, finance_sec_search
The verifier and agent are separately defined, but the agent is hardcoded in the config. Running workplace_assistant with claude_code_agent instead of simple_agent requires creating a new config — there is no CLI flag that does it:
# environments/workplace_assistant/config.yaml
workplace_assistant_simple_agent:
responses_api_agents:
simple_agent: # hardcoded — must create a new config to change this
max_steps: 6
resources_server:
name: workplace_assistantGroup 2: Self-contained environments: swapping requires new code
Examples: swe_agents (openhands, opencode), mini_swe_agent, harbor_agent
The agent, container, dataset, and execution logic are bundled together. swebench_openhands.yaml and swebench_opencode.yaml are structurally independent configs — not two configurations of the same benchmark. Scoring logic lives inside the agent server itself, not in a separate resources server. Swapping agents requires implementing a new agent class:
# responses_api_agents/swe_agents/configs/swebench_openhands.yaml
swe_agents:
responses_api_agents:
swe_agents:
agent_framework: openhands # hardcoded — cannot be changed via --agent-type
container_formatter: ??? # container must match the agentGroup 3: Architecturally coupled: swapping requires changing both agent and verifier code
Examples: gdpval + stirrup_agent, legal_agent_bench + harbor_agent
The resources server has a hard import dependency on a specific agent implementation. No config change can decouple these:
# resources_servers/gdpval/app.py — verifier imports directly from stirrup_agent
from responses_api_agents.stirrup_agent.file_reader import ...
# resources_servers/legal_agent_bench/harbor_bridge.py — verifier subclasses harbor_agent
from responses_api_agents.harbor_agent.app import HarborAgent
class LegalAgentBenchHarborBridge(HarborAgent): ...Group 4: Plugin pattern: extension point exists but no CLI composition
Examples: cvdp_agent, anyterminal_agent, reasoning_gym
An explicit agent_server_module / agent_server_class extension point exists in the config — a partial solution someone already built. Swapping still requires creating a new config file per agent; --agent-type hermes does not work from the CLI. reasoning_gym shows this at scale: 8 hand-authored agent config variants (reasoning_gym_claude_code_agent.yaml, orchestrator_agent.yaml, parallel_thinking_agent.yaml, etc.) because there was no other way:
# cvdp_agent_generic_claude.yaml — agent is pluggable but still requires a new file
cvdp_agent_generic_claude:
responses_api_agents:
cvdp_agent:
agent_server_module: responses_api_agents.claude_code_agent.app
agent_server_class: ClaudeCodeAgent
agent_config_class: ClaudeCodeAgentConfigGroup 5: External library adapters: swappability outside Gym's control
Example: aviary
Gym wraps an external Python library (from aviary.core import ...). The environment semantics, task structure, and agent interface are defined by the external package. Swappability depends on what that library supports, not on Gym's config system.
What has already been delivered
--model,--model-url,--model-api-key— model identity overrideable at invocation time ✅--model-type NAME— named model server resolved to config via asset selector ✅--environment NAMEand--benchmark NAME— named environment/benchmark resolved to config ✅gym list agents,gym list models,gym list environments— all components discoverable ✅
Remaining gap is agent swappability
--agent-type NAME today sets agent_name as a string override only. It does not resolve the named agent to its config path the way --environment does. There is no asset selector for agents.
The goal:
gym eval run \
--agent-type claude_code \
--env workplace_assistant \
--model gpt-4oSwapping agents requires only changing --agent-type. No new YAML file needed. Or clear definititions of incompatibility through a support matrix via #2001.
Agent Harness Priorities
| Harness | Priority | In Gym? | Notes |
|---|---|---|---|
| Hermes | P0 | ✅ | hermes_agent — composable (Pattern A), can be wired to any environment. |
| OpenCode | P0 | ✅ | opencode_agent — composable (Pattern A). |
| Pi | P0 | ✅ | pi_agent — composable (Pattern A). |
| OpenHands | P0 | Exists inside swe_agents only. Bundled with SWE-bench (Pattern B), not available as a standalone composable harness. |
|
| Codex | P0 | ✅ | codex_agent — recently landed on main. |
| Stirrup | P0 | stirrup_agent exists but is tightly coupled to GDPVal (Group 3: architectural coupling), so it is not generally composable. |
|
| SpatialClaw | P0 | ❌ | Not in Gym. openclaw_agent exists. Clarify whether SpatialClaw is a variant of OpenClaw or a distinct agent. |
| Agent006 | P0 | ❌ | Not in Gym. |
| LangChain | P0 | langgraph_agent exists (LangGraph orchestration patterns such as orchestrator, parallel thinking, reflection, ReWOO). Clarify whether "LangChain" refers to LangGraph. |
|
| KiloCode | P1 | ✅ | kilocode_agent exists. |
| CoPilot | P1 | ❌ | Not in Gym. |
| Perplexity Harness | P0 | resources_servers/perplexity_summarizer exists as a verifier/resource server, not an agent harness. There is no perplexity_agent. |
Acceptance criteria
-
--agent-type NAMEresolves a named agent to its config via asset selector — same pattern as--environment(local path supported) - Swapping agents does not require creating new YAML files
-
gym eval run --agent-type X --env Y --model Zcomposes into a valid config without--config - Existing benchmark-based workflows continue to function unchanged
- CLI help text documents agent swapping workflow
References
- Related: [Epic] Search & Discoverability for Environments and Components from the CLI #1582
- Related: [epic] Ease of use for creating custom environments #1520
- Related: Add component versions, code identity, and compatibility metadata #2001
- Related: epic: reduce configuration friction for environment authors and users #1205
- Related: Epic: Gym CLI usability -- first class CLI experience #1434
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
[-][Epic] Swappable Components & Composable Evaluation in the Gym CLI[/-][+]epic: Swappable Components & Composable Evaluation in the Gym CLI[/+][-]epic: Swappable Components & Composable Evaluation in the Gym CLI[/-][+]epic: Agent swappability — first-class --agent selector in the CLI[/+]25 remaining items
--agentCLI flag that allows to select agent at runtime #2654--agent-typeCLI flag #2656feat(data): collate stamps task_source; datasets declarable on resour…
[-]epic: Agent swappability — first-class --agent selector in the CLI[/-][+]epic: Agent swappability — first-class --agent-type selector in the CLI[/+]marta-sd commentedon Aug 28, 2026
@sephmard the
--agentflag was already taken - it allows to select agent instance for collecting rollouts. I have added the new flag as--agent-typefor consistency with--model-typewe already have and updated the ticket's title and description.