Skip to content

Harness models ​

declareHarness ​

File: parameters/harnessModels/<harness>/index.ts

How to install and run an agent. Takes the shared options too.

version ​

Type: string

Required. The version of the agent this harness installs, e.g. "2.1.311": ctx.version for its fragment. One harness folder pins one version, so name the folder after it, e.g. claude-code-2.1.311/, and copy the folder to try another.

models ​

Type: Record<string, ModelSetting[]>

The models the agent runs, by their real IDs, each with its settings, one setting per entry. A fixed setting, e.g. { reasoningEffort: "low" }, adds nothing to the pair's name. A variant setting, { reasoningEffort: { values: ["low", "high"] } }, adds one required part, e.g. codex-0.166.0/openai/gpt-6.1-sol/high. Several make their cross product, parts in array order. A test case may only name these. ctx.model is the settings, each variant's value chosen.

applyParameter ​

Type: (config, ctx: HarnessApplyCtx) => string

Required. Installs the agent, and writes /thunderjar/thunderjar-run.sh, the script that runs it, e.g. with writeRunScript. The script runs in the image's working directory, reads the prompt from /thunderjar/prompt.txt, and must leave the agent's result at /thunderjar/result.json. writeModel(ctx.modelId) puts the model ID at /thunderjar/model.txt, for it to read. ctx has dir, version, modelId, and resolved, what resolve returned.

collectReply ​

Type: (raw: string) => string

The agent's final reply, read from the text of its result file, for instruments such as replyMatches to measure. Without it, a run has no reply.

collectTokenCosts ​

Type: (raw: string, ctx: { version: string; modelId: string }) => TokenCosts

The run's token costs, read from the text of its result file. A throw is unparseable. Without it, every run's are notReported.

requiredEnv ​

Type: (string | { oneOf: string[] })[]

The names of the environment variables the agent needs, e.g. its API key. An entry { oneOf: [...] } needs any one of them, e.g. a subscription token or an API key: the first that's set is passed, and only that one, and the run's record names it. Each is passed into this harness's agent containers only, as docker run -e NAME, so its value comes from the shell that runs Thunderjar, and is never on a command line or in a log. Its postrun image doesn't keep it: when the container is committed, every variable its prerun image doesn't set is blanked. Its measurement containers, started from the postrun image, are given it the same way, by name. run stops if one is unset. If the agent writes its value into a file, the postrun image's files are searched for it before it's pushed, and run warns.