Skip to navigation

Compare Harnesses

View as MarkdownOpen in Claude

An agent harness turns a model into an agent: it manages conversation state, routes tool calls, and decides when a task is complete. Two harnesses can produce materially different scores on the same model and tasks, and a harness that performs well with one model may underperform with another. Treat the harness as an experimental variable to isolate and evaluate, not a fixed part of the environment

--agent-type runs an environment or benchmark with a harness other than the one its config names, without editing any config. To ablate the harness, hold everything else fixed — model, dataset, and repeat count — and vary only --agent-type, writing each run to its own output:

gym list agents
gym eval run \
--benchmark terminal_bench_2_1/opencode \
--agent-type terminus_2_sandboxed_agent \
--sandbox opensandbox \
--model-type vllm_model

terminal_bench_2_1/opencode runs on the harbor Environment Server, so --agent-type selects the harness that server binds for the same tasks; nothing is composed or renamed.

Each run writes its own _aggregate_metrics.json next to its rollouts file. Comparing those across harnesses is the ablation — for example (illustrative, not real output):

HarnessPass rate
opencode_agent41%
terminus_2_sandboxed_agent68%

A spread this size, with the model and dataset held identical, means the harness — not the model — is the lever to pull. Refer to Diagnose Results to have an agent explain why the harnesses diverged, or Aggregate Metrics to build your own comparison across shards. For the flag reference itself, see Swapping the agent.

Select a harness release

Set openclaw_version, opencode_version, hermes_version, or pi_version on the corresponding agent in the config you pass to gym env start. For example, add this override to an existing OpenCode config:

opencode_agent:
responses_api_agents:
opencode_agent:
opencode_version: "1.17.11"

For harness_agent, harness_exa_search, anyswe_agent, and anyterminal_agent, put the selected agent’s field under agent_kwargs. A wrapper that installs its own Gym adapter in the sandbox needs an adapter that supports the selected release.

Use "latest" to resolve the publisher’s latest release at startup. Workers in that launch share the resolved version. Copy the version from the startup log to repeat the run. Omitting the setting uses the agent’s configured default.

OpenClaw and Pi use npm’s latest tag. OpenCode and Hermes use the release marked latest on GitHub. Hermes also accepts a full commit SHA and an optional hermes_repo (for example, https://github.com/your-team/hermes-agent). Its worker installs dependencies from the selected checkout’s own lock. Selecting a release leaves Gym’s checked-in lockfiles untouched. A selected release must support the adapter’s CLI or Python interfaces and the task sandbox’s platform.

The composed instance is renamed

For a benchmark that composes its own servers, such as the relay recipe terminal_bench_2_1/opencode_legacy_agent, composition replaces the environment’s agent and renames the server instance after the harness that runs it, so metrics and gym env status report what actually ran. Composing terminus_2_sandboxed_agent onto terminal_bench_2_1_opencode_sandboxed_agent produces terminal_bench_2_1_terminus_2_sandboxed_agent.

That name is what you use to route rollouts when the servers are already up:

gym env start \
--benchmark terminal_bench_2_1/opencode_legacy_agent \
--agent-type terminus_2_sandboxed_agent \
--model-type vllm_model
gym eval run --no-serve --agent terminal_bench_2_1_terminus_2_sandboxed_agent --input rows.jsonl

End-to-end rollouts collection (without the --no-serve flag) keeps working — rows stamped with the pre-swap instance are re-routed for you under the hood.

Not every pairing is valid

A verifier is written against the behavior of a particular harness. A resources server can declare which harnesses are compatible with it in allowed_agents, and Gym refuses an undeclared pairing before any server starts:

'simple_agent' is not declared compatible with 1 of the agent instance(s) it would replace,
so it cannot be scored correctly:
- terminal_bench_2_1_opencode_sandboxed_agent uses terminal_bench_2_1_opencode_resources_server
and accepts opencode_sandboxed_agent, terminus_2_sandboxed_agent
Select one of: opencode_sandboxed_agent, terminus_2_sandboxed_agent. Or pass
--allow-unsupported-pairing (or set NEMO_GYM_ALLOW_UNSUPPORTED_PAIRING=1) to bypass the check.

--allow-unsupported-pairing bypasses this check at your own risk: an unsupported harness can score incorrectly without erroring.

A server that declares nothing accepts any harness — such environments are swappable without further setup.

Self-contained environments

Some agent servers own their environment and declare no resources server. Those are left alone by a swap, because there would be nothing for the incoming harness to bind to. If every agent in a config is self-contained, selecting a harness fails with no other agent instance to rehost it on.

Session agents are not composed

A session agent such as codex_agent, hermes_agent, or opencode_agent sets resources_server: null, so --agent-type cannot put it in place of a benchmark’s agent. Gym refuses such a selection before any server starts and lists where each task would run instead:

--agent-type loaded codex_agent (codex_agent), but these tasks would still run on another agent:
- taskset 'swebench:pro' of swebench_pro_opencode_agent_resources_server routes to
swebench_pro_opencode_single_agent_turn, which runs swebench_pro_opencode_agent (opencode_agent)

To compare session agents, run a benchmark config that binds each of them (gym list benchmarks), or bind the agent yourself as Swapping the agent describes.