> ## Documentation Index
> Fetch the complete documentation index at: https://agent-compass.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

The `openclaw` harness runs an [OpenClaw](https://openclaw.ai) agent inside a prepared environment's container, driving the model-under-test through tasks one at a time — commonly used for OpenClaw-style productivity / agentic-coding benchmarks (such as [PinchBench](https://agent-compass.mintlify.site/en/user_guide/modules/benchmarks/pinchbench.md) and [SkillsBench](https://agent-compass.mintlify.site/en/user_guide/modules/benchmarks/skillsbench.md)).

You only need to provide the model's access credentials; the harness handles the rest: it installs `openclaw` in the container, onboards your model to OpenClaw as a callable custom model, then runs the tasks one by one and collects the results. Credentials are passed on the command line via `--model-base-url` / `--model-api-key`, and both the `openai-chat` and `openai-responses` `--model-api-protocol` protocols are supported (`openai-responses` needs OpenClaw 2026.6.1 or later, newer than the default `2026.3.22` install).

## Parameters

Pass a chunk of JSON via `--harness-params '{...}'`, or write it into the `harness.params` block of the YAML given to `--config`; on shared keys the command line wins (deep-merge override). For merge and precedence, see the [Harnesses overview](https://agent-compass.mintlify.site/en/user_guide/modules/harnesses/overview.md).

### Parameter reference

<table>
  <thead>
    <tr><th>Parameter</th><th>Type</th><th>Default</th><th>Choices / values</th><th>Description</th></tr>
  </thead>

  <tbody>
    <tr><td>`binary`</td><td>string</td><td>`openclaw`</td><td>—</td><td>Name or full path of the `openclaw` executable; usually no need to change.</td></tr>
    <tr><td>`install_strategy`</td><td>string</td><td>`install_if_missing`</td><td>5 options</td><td>How to prepare `openclaw` in the container; 5 in total (see [Install strategy](#install-strategy) below).</td></tr>
    <tr><td>`openclaw_version`</td><td>string</td><td>`2026.3.22`</td><td>—</td><td>The `openclaw` version used when auto-installing; only takes effect when `install_strategy` triggers an install.</td></tr>
    <tr><td>`install_command`</td><td>string</td><td>`""`</td><td>—</td><td>Custom install command. When empty, it is auto-assembled from `openclaw_version` as `npm install -g openclaw@<version>`.</td></tr>
    <tr><td>`upload_src`</td><td>string</td><td>`""`</td><td>—</td><td>Only used when `install_strategy` is the [`upload` strategy](#install-strategy): the path to the `openclaw` executable on the local machine (the one running AgentCompass) to upload; required under that strategy.</td></tr>
    <tr><td>`upload_dst`</td><td>string</td><td>`/usr/local/bin/openclaw`</td><td>—</td><td>Only used when `install_strategy` is the [`upload` strategy](#install-strategy): the destination path inside the container, which is also the `openclaw` path actually used at runtime.</td></tr>
    <tr><td>`setup_capsule_tag`</td><td>string</td><td>`""`</td><td>`node24-v1`</td><td>Optional predefined Node toolchain Capsule injected before installing `openclaw`, for images without a usable Node.js / npm (see [Install strategy](#install-strategy) below).</td></tr>
    <tr><td>`provider_id`</td><td>string</td><td>`vllm`</td><td>—</td><td>The name your model is registered under in OpenClaw; keep the default unless you need to align with a name in existing config.</td></tr>
    <tr><td>`gateway_port`</td><td>int</td><td>`18789`</td><td>≥ 1</td><td>The local port OpenClaw uses to reach your model; change it only if it conflicts with another service.</td></tr>
    <tr><td>`gateway_bind`</td><td>string</td><td>`loopback`</td><td>—</td><td>The gateway's listen scope; defaults to `loopback` (localhost only).</td></tr>
    <tr><td>`openclaw_local`</td><td>bool</td><td>`true`</td><td>`true` / `false`</td><td>Whether to run OpenClaw in local mode (`--local`); on by default.</td></tr>
    <tr><td>`brave_api_key`</td><td>string</td><td>`${BRAVE_API_KEY}`</td><td>—</td><td>Injects a Brave Search API key into OpenClaw; when provided, OpenClaw can use Brave for `web_search`. When not explicitly provided, `web_search` may be limited or unavailable. See the [OpenClaw Web Search documentation](https://docs.openclaw.ai/tools/web).</td></tr>
    <tr><td>`max_message_chars`</td><td>int</td><td>`131072`</td><td>≥ 1</td><td>Maximum characters in a single message sent to the model; longer messages are automatically split into several sent in sequence.</td></tr>
    <tr><td>`max_tokens`</td><td>int</td><td>`0`</td><td>≥ 0</td><td>Max output tokens for a single model reply; `0` means unset, using the model's own default. See [Context and token limits](#context-and-token-limits) below.</td></tr>
    <tr><td>`context_window`</td><td>int</td><td>`250000`</td><td>≥ 0</td><td>Tells OpenClaw how long a context your model accepts; `0` means unset. For custom models, set the real value; see [Context and token limits](#context-and-token-limits) below.</td></tr>
    <tr><td>`provider_timeout_seconds`</td><td>int</td><td>`3600`</td><td>—</td><td>How long the model service can stay idle before being reclaimed (seconds).</td></tr>
    <tr><td>`max_turns`</td><td>int</td><td>`0`</td><td>≥ 0</td><td>Maximum model calls per task; `0` means no limit. See [Turn limit](#turn-limit).</td></tr>
    <tr><td>`model_input`</td><td>list</td><td>`[]`</td><td>`text`, `image`</td><td>Input types declared for the model in `openclaw.json`. Set `["text", "image"]` for a vision model so `view_image` sends images to it directly. Empty keeps the OpenClaw default; `text` is required.</td></tr>
  </tbody>
</table>

### Install strategy

`install_strategy` decides how `openclaw` lands in the container:

* `install_if_missing` (default) — installs only when `openclaw` is not present in the container. The install runs `npm`, so an image without `openclaw` must provide a Node.js that OpenClaw supports plus npm, or set `setup_capsule_tag`.
* `preinstalled` — uses what's already installed on the image; errors if absent.
* `auto` — picks a strategy by environment (not a probing auto-install): [`host_process`](https://agent-compass.mintlify.site/en/user_guide/modules/environments/overview) uses `install_if_missing`, [other environments like docker](https://agent-compass.mintlify.site/en/user_guide/modules/environments/overview.md) use `preinstalled`.
* `install_always` — reinstalls on every run (some benchmarks pin `install_if_missing`, in which case the benchmark's setting takes precedence).
* `upload` — instead of installing from npm, uploads an existing `openclaw` executable from your local machine (the one running AgentCompass) into the container: it uploads from `upload_src` to `upload_dst`, adds the executable bit, and uses that file at runtime (`binary` automatically points to `upload_dst`, no need to set it separately). Suited to containers that can't reach npm, or when you want a self-compiled / pinned binary; `upload_src` is required in this case.

Setting `openclaw_version` is enough — `install_command` is auto-derived as `npm install -g openclaw@<version>`. Set `install_command` explicitly only when you need to point at an internal registry or a non-npm source.

When the image has no usable Node.js / npm, set `setup_capsule_tag` (for example `--harness-params '{"setup_capsule_tag": "node24-v1"}'`): the harness first injects a [Runtime Capsule](https://agent-compass.mintlify.site/en/developer_guide/architecture/runtime_capsules.md) that ships Node 24 and npm, runs `install_command` with it, and then launches `openclaw` through the Capsule. The `preinstalled` strategy never uses a Capsule, and `install_if_missing` skips it when the image already has `openclaw`. The [SkillsBench](https://agent-compass.mintlify.site/en/user_guide/modules/benchmarks/skillsbench.md) docker recipe sets `node24-v1` by default and installs `2026.7.1` unless a version is given.

### Context and token limits

`context_window` and `max_tokens` are written into `openclaw.json` only when **set greater than 0**, and are independent of each other.

* **`context_window`** — the model's total context length (corresponds to [vLLM](https://docs.vllm.ai/)'s `--max-model-len`). Setting it explicitly stops OpenClaw from falling back to an over-small default window when it can't recognize the model-under-test, which would trigger context compaction prematurely. When the value is `0`, AgentCompass does not write the field into `openclaw.json` and the window is left to OpenClaw: if OpenClaw has a built-in context window for the model, it uses that built-in value; if it's an unrecognized custom model, it falls back to a smaller default window and may compact the context before it has actually exceeded the limit, losing information and hurting long-task performance. Passing the model-under-test's real context length explicitly during evaluation is therefore recommended.
* **`max_tokens`** — the per-turn completion budget; it should be noticeably smaller than `context_window` so that "input tokens + `max_tokens`" doesn't exceed the served context length. When the value is `0` it is likewise not written into `openclaw.json`, and the model / server's own default output limit applies.

### Turn limit

OpenClaw has no turn limit of its own. When `max_turns` is greater than `0`, the harness installs and enables a small plugin under `~/.openclaw/extensions/agentcompass/` that counts model calls and ends the `openclaw` process before call `max_turns + 1` is sent. This matches the `step_limit` of [mini-SWE-agent](https://agent-compass.mintlify.site/en/user_guide/modules/harnesses/mini_swe_agent.md): one model call is one turn however many tools it requests, all prompts of a task share the limit, and retries inside a model request are not counted. Reaching the limit records ERROR `harness_max_iterations`, and the output is still collected and scored.

This requires OpenClaw 2026.5.7 or later and `openclaw_local: true`; other setups fail with an error. The default `openclaw_version` is older, so set it as well.

### Session transcript

Results are collected from the session OpenClaw stores on disk. Releases that write `~/.openclaw/agents/<agent>/sessions/<session>.jsonl` are read from that file; releases that keep the conversation in the agent's SQLite session database (`~/.openclaw/agents/<agent>/agent/openclaw-agent.sqlite`) are read from a copy of that database. A transcript the harness cannot read leaves the trajectory empty without failing the run.

Each step's `tools` lists the tool definitions offered to the model. On OpenClaw 2026.7.1 or later, the same plugin as the turn limit saves the definitions the agent hands to the model (the `llm_input` hook, which the harness allows with `plugins.entries.agentcompass.hooks.allowConversationAccess`). Otherwise they come from the run's trajectory, which OpenClaw records only in part: it keeps at most 64 objects and 6 levels per event, so complete definitions survive only on some releases. When [Tool Search](https://docs.openclaw.ai/tools/tool-search) hides part of the catalog, which it does by default on recent releases such as 2026.9.36 and 2026.10.10, OpenClaw's record of the tools the model saw is cut short, so `tools` stays empty. A run stopped at `max_turns` ends before OpenClaw writes its trajectory, so its `tools` stays empty as well. `telemetry.tool_definitions_source` names the source: `llm_input`, `trajectory`, `unavailable_tool_search` or `unavailable`.

## Run examples

Pass `openclaw` as the second positional argument in this command:

```bash theme={"system"}
agentcompass run <benchmark> openclaw <model>
```

Pass Harness configuration through `--harness-params`.

> [tab] Default configuration
>
> OpenClaw is already installed on the image — run with the default parameters.
>
> ```bash theme={"system"}
> agentcompass run \
>   pinchbench \
>   openclaw \
>   "$MODEL_NAME" \
>   --env docker \
>   --model-base-url "$MODEL_BASE_URL" \
>   --model-api-key "$MODEL_API_KEY" \
>   --model-api-protocol openai-chat
> ```

> [tab] Install a pinned version
>
> When the container isn't preinstalled (or you want to switch versions), let the harness install a pinned version and give it a generous wall-clock timeout.
>
> ```bash theme={"system"}
> agentcompass run \
>   gdpval_ac \
>   openclaw \
>   "$MODEL_NAME" \
>   --env docker \
>   --harness-params '{"install_strategy": "install_if_missing", "openclaw_version": "2026.5.7"}' \
>   --execution-params '{"run_timeout_seconds": 14400}' \
>   --model-base-url "$MODEL_BASE_URL" \
>   --model-api-key "$MODEL_API_KEY" \
>   --model-api-protocol openai-chat
> ```

> [tab] Custom provider and limits
>
> Write the context window and per-turn token budget for a custom model, and pin the provider id.
>
> ```bash theme={"system"}
> agentcompass run \
>   wildclawbench \
>   openclaw \
>   "$MODEL_NAME" \
>   --env docker \
>   --harness-params '{
>     "provider_id": "vllm",
>     "context_window": 262144,
>     "max_tokens": 32768
>   }' \
>   --model-base-url "$MODEL_BASE_URL" \
>   --model-api-key "$MODEL_API_KEY" \
>   --model-api-protocol openai-chat
> ```

Set the task execution deadline through `--execution-params` with `run_timeout_seconds` and `run_timeout_multiplier`. See [phase timeouts](https://agent-compass.mintlify.site/en/user_guide/using_agentcompass/timeouts.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.