Adding Harnesses¶
WARNING
This documentation is almost entirely "vibe coded"; while a helpful resource for humans and agents to understand this codebase, it should not be considered a source of ground truth in the way documentation normally is, and the user is responsible for verifying that all instructions given here are safe.
Guide to adding a new harness to ABC Runner.
A harness is the layer that tells ABC Runner how to run a particular agent. It is not the model configuration, and it is not the task. It is the execution adapter between the benchmark runner and an agent tool.
Harness Model¶
A harness has two pieces:
- runtime assets under
harnesses/<harness>/ - a container template under
containers/harnesses/<harness>.Dockerfile.jinja2
This split is deliberate. Harness directories contain runtime assets and metadata. Container recipes live with the rest of the layered container system.
Required Files¶
Harness runtime assets:
Container template:
Harness Metadata¶
Example harness.yaml:
id: my-harness
description: My custom harness
entrypoint: run_benchmark.sh
container_template: my-harness
container_template maps to:
Standard Interface¶
run_benchmark.sh is the critical file. It must accept the staged benchmark
inputs supplied by the runner.
The effective interface is:
./run_benchmark.sh \
--workspace PATH \
--task-prompt PATH \
--system-prompt PATH \
--models-config PATH \
--harness-config PATH \
--output-dir PATH \
--timeout-seconds N \
--task-env PATH
The script should:
- validate arguments
- read the generated models config and harness config
- export the right API credentials for the agent
- combine or otherwise supply the system and task prompts
- run inside the staged workspace
- write logs into
--output-dir - respect the timeout contract
That interface is what makes it possible for the runner to treat different agent backends uniformly.
Container Template¶
Example:
{{ parent_image }} is rendered by the container manager so the harness layer
inherits from the shared base image.
Prefer putting common runtime dependencies in containers/base.Dockerfile.jinja2
when more than one harness will need them. For example, OpenCode's glob and
grep tools require ripgrep, so ABC Runner installs ripgrep in the shared
base layer rather than duplicating it in each OpenCode-derived harness
container.
Build Flow¶
Build the harness layer:
Build a final runtime for one task group:
The second command is the one that matters for actual benchmark execution.
Quick Start¶
The easiest path is to copy an existing harness and then update both the runtime assets and the container template.
Then create:
Which harness to copy from matters:
harnesses/opencodeis the simplest single-model example.harnesses/opencode-hybridshows a two-model planner/builder flow and readingharness_config.harnesses/codexshows wrapping a CLI that emits a JSONL event stream, and isolating per-run agent state.harnesses/claude-codeshows a CLI on a non-OpenAI wire protocol (the Anthropic Messages API), restricting the agent's tool set, and distinguishing an errored agent result from a process failure.
Copy the exit-status handling from opencode-hybrid or codex, not from
opencode: see the pipeline warning under Common Mistakes.
What To Test¶
Before treating a harness as usable, verify all three layers:
abc-runner build-container my-harnessabc-runner build-container my-harness/smoke_testabc-runner run --task smoke_test/hello-world-python --agent my-agent
Common Mistakes¶
- adding a harness directory without adding a matching container template
- building only the harness layer and forgetting the task-group runtime
- assuming the runner executes the harness layer directly
- not writing logs to the harness output directory
- hard-coding provider credentials instead of using the generated models config
- reading
$?after piping the agent intotee: that capturestee's status, which is essentially always0, so timeouts and agent failures silently look like success. UseEXIT_CODE="${PIPESTATUS[0]}". - writing agent state into the container
HOME(/var/tmp/automaton-home), which is shared and mode0777and therefore collides across parallel attempts. Create a per-runmktemp -dand clean it up in atrap. - treating
--group-promptand--timeout-secondsas always present: the runner omits--group-promptwhen the task group has nogroup_prompt.md. - granting a tool's availability without granting permission to call it. An
agent that can see a tool but is refused when it calls it typically explains
that it cannot do the task and exits
0, which grades as a plausibleFAILwhile actually being a harness bug. Check the allow list against the offered list directly; note that a denial event cannot distinguish this bug from an intended refusal, so it is not a usable signal on its own. - trusting a CLI's "success" field without checking its error field. Some CLIs
report a successful invocation alongside
is_error: truefor an API failure; reading only the former grades a run that never reached the model. - disabling the agent CLI's own request retries on the assumption that the model
proxy covers them. The proxy retries transport failures only; an upstream
HTTP
5xxis forwarded to the client verbatim, so the CLI is the only thing that can ride out a transient one.