Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(bench): add OpenHuman benchmark harness

Steven Enamakel81ffc05a3e07
diff --git a/bench/harnesses/bundles/Dockerfile.openhuman b/bench/harnesses/bundles/Dockerfile.openhuman
new file mode 100644
index 0000000000..dbe58a4825
--- /dev/null
+++ b/bench/harnesses/bundles/Dockerfile.openhuman
@@ -0,0 +1,38 @@
+# OpenHuman harness bundle, built from this checkout (build context = repo root).
+# Ubuntu 22.04 (not the root Dockerfile's bookworm) so the binary's glibc floor
+# is compatible with the official SWE-bench instance images.
+FROM ubuntu:22.04 AS builder
+ENV DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ build-essential cmake pkg-config libssl-dev libasound2-dev libxdo-dev libxtst-dev \
+ libx11-dev libevdev-dev clang mold ca-certificates git curl \
+ && rm -rf /var/lib/apt/lists/*
+# Toolchain pinned by rust-toolchain.toml.
+COPY rust-toolchain.toml /build/rust-toolchain.toml
+RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal \
+ --default-toolchain "$(sed -n 's/^channel *= *"\(.*\)"/\1/p' /build/rust-toolchain.toml)"
+ENV PATH=/root/.cargo/bin:$PATH
+WORKDIR /build
+COPY . .
+ARG CARGO_PROFILE=release
+RUN --mount=type=cache,target=/root/.cargo/registry \
+ --mount=type=cache,target=/build/target \
+ cargo build --profile "${CARGO_PROFILE}" -p openhuman-cli --bin openhuman-core \
+ && install -D "target/$([ "${CARGO_PROFILE}" = release ] && echo release || echo "${CARGO_PROFILE}")/openhuman-core" /out/openhuman/openhuman-core
+
+FROM ubuntu:22.04 AS bundle
+ARG GIT_SHA=unknown
+ARG ADAPTER=adapters/openhuman.sh
+RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates xz-utils \
+ && rm -rf /var/lib/apt/lists/*
+ARG NODE_MAJOR=24
+RUN set -eux; mkdir -p /opt/harness/node; \
+ base="https://nodejs.org/dist/latest-v${NODE_MAJOR}.x"; \
+ file="$(curl -fsSL "$base/SHASUMS256.txt" | awk '/linux-x64.tar.xz/{print $2}')"; \
+ curl -fsSL "$base/$file" | tar -xJ --strip-components=1 -C /opt/harness/node
+COPY --from=builder /out/openhuman /opt/harness/openhuman
+COPY bench/harnesses/bundles/adapters/_common.sh /opt/harness/_common.sh
+COPY bench/harnesses/bundles/adapters/openhuman-base.sh /opt/harness/openhuman-base.sh
+COPY bench/harnesses/bundles/${ADAPTER} /opt/harness/adapter.sh
+COPY bench/harnesses/bundles/forward.mjs /opt/harness/forward.mjs
+RUN echo "${GIT_SHA}" > /opt/harness/openhuman/GIT_SHA
diff --git a/bench/harnesses/bundles/Dockerfile.openhuman.dockerignore b/bench/harnesses/bundles/Dockerfile.openhuman.dockerignore
new file mode 100644
index 0000000000..50496503ab
--- /dev/null
+++ b/bench/harnesses/bundles/Dockerfile.openhuman.dockerignore
@@ -0,0 +1,11 @@
+target/
+crates/openhuman-app/target/
+app/
+node_modules/
+dist/
+.git/
+worktrees/
+bench/harnesses/.cache/
+bench/harnesses/results/
+**/node_modules/
+**/target/
diff --git a/bench/harnesses/bundles/adapters/openhuman-base.sh b/bench/harnesses/bundles/adapters/openhuman-base.sh
new file mode 100755
index 0000000000..f07c9bebb6
--- /dev/null
+++ b/bench/harnesses/bundles/adapters/openhuman-base.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+. "$(dirname "$0")/_common.sh"
+# Loopback hop to the metering proxy (see forward.mjs).
+proxy_host="${PROXY_URL#http://}"; proxy_host="${proxy_host%%:*}"
+proxy_port="${PROXY_URL##*:}"
+node /opt/harness/forward.mjs 18080 "$proxy_host" "$proxy_port" &
+fwd=$!
+trap 'kill $fwd 2>/dev/null || true' EXIT
+for _ in $(seq 1 50); do (echo > /dev/tcp/127.0.0.1/18080) 2>/dev/null && break; sleep 0.1; done
+
+export OPENHUMAN_WORKSPACE="$HOME/oh-workspace"
+export OPENHUMAN_ACTION_DIR="$WORKDIR_ABS"
+mkdir -p "$OPENHUMAN_WORKSPACE"
+# Variant knob: `openhuman-jev` exports the TinyHumans credential that lets the
+# JEV tool ranker run (see openhuman-jev.sh); plain `openhuman` falls back to BM25.
+[ -n "${OH_EXTRA_ENV_SCRIPT:-}" ] && . "$OH_EXTRA_ENV_SCRIPT"
+
+params="$(node -e '
+ const fs = require("fs");
+ process.stdout.write(JSON.stringify({
+ message: fs.readFileSync(process.env.PROMPT_FILE, "utf8"),
+ cwd: process.env.PWD,
+ inference_url: "http://127.0.0.1:18080/v1",
+ api_key: process.env.DUMMY_API_KEY,
+ model_override: process.env.BENCH_MODEL,
+ }));
+')"
+/opt/harness/openhuman/openhuman-core call \
+ --method openhuman.inference_agent_chat --params "$params"
diff --git a/bench/harnesses/bundles/adapters/openhuman-jev.sh b/bench/harnesses/bundles/adapters/openhuman-jev.sh
new file mode 100755
index 0000000000..6c92619017
--- /dev/null
+++ b/bench/harnesses/bundles/adapters/openhuman-jev.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+# OpenHuman with JEV tool ranking on. The ranker calls the TinyHumans backend's
+# OpenRouter/SystemOne proxy with a TinyHumans credential; that traffic does not
+# pass through the metering proxy, so JEV's own cost is reported separately.
+: "${TINYHUMANS_API_KEY:?openhuman-jev needs TINYHUMANS_API_KEY}"
+export OPENHUMAN_BACKEND_API_KEY="$TINYHUMANS_API_KEY"
+exec "$(dirname "$0")/openhuman-base.sh"
diff --git a/bench/harnesses/bundles/adapters/openhuman.sh b/bench/harnesses/bundles/adapters/openhuman.sh
new file mode 100755
index 0000000000..f07c9bebb6
--- /dev/null
+++ b/bench/harnesses/bundles/adapters/openhuman.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+. "$(dirname "$0")/_common.sh"
+# Loopback hop to the metering proxy (see forward.mjs).
+proxy_host="${PROXY_URL#http://}"; proxy_host="${proxy_host%%:*}"
+proxy_port="${PROXY_URL##*:}"
+node /opt/harness/forward.mjs 18080 "$proxy_host" "$proxy_port" &
+fwd=$!
+trap 'kill $fwd 2>/dev/null || true' EXIT
+for _ in $(seq 1 50); do (echo > /dev/tcp/127.0.0.1/18080) 2>/dev/null && break; sleep 0.1; done
+
+export OPENHUMAN_WORKSPACE="$HOME/oh-workspace"
+export OPENHUMAN_ACTION_DIR="$WORKDIR_ABS"
+mkdir -p "$OPENHUMAN_WORKSPACE"
+# Variant knob: `openhuman-jev` exports the TinyHumans credential that lets the
+# JEV tool ranker run (see openhuman-jev.sh); plain `openhuman` falls back to BM25.
+[ -n "${OH_EXTRA_ENV_SCRIPT:-}" ] && . "$OH_EXTRA_ENV_SCRIPT"
+
+params="$(node -e '
+ const fs = require("fs");
+ process.stdout.write(JSON.stringify({
+ message: fs.readFileSync(process.env.PROMPT_FILE, "utf8"),
+ cwd: process.env.PWD,
+ inference_url: "http://127.0.0.1:18080/v1",
+ api_key: process.env.DUMMY_API_KEY,
+ model_override: process.env.BENCH_MODEL,
+ }));
+')"
+/opt/harness/openhuman/openhuman-core call \
+ --method openhuman.inference_agent_chat --params "$params"
diff --git a/bench/harnesses/bundles/forward.mjs b/bench/harnesses/bundles/forward.mjs
new file mode 100644
index 0000000000..ddae2dd128
--- /dev/null
+++ b/bench/harnesses/bundles/forward.mjs
@@ -0,0 +1,18 @@
+// forward.mjs <listenPort> <targetHost> <targetPort> — a plain TCP forwarder.
+// OpenHuman refuses to send a bearer to a non-loopback http endpoint, so its
+// adapter reaches the metering proxy through 127.0.0.1. Bytes pass through
+// untouched; the cost is a few KB of RAM and negligible CPU.
+import net from "node:net";
+const [listenPort, host, port] = process.argv.slice(2);
+net
+ .createServer((client) => {
+ const upstream = net.connect(Number(port), host);
+ client.pipe(upstream).pipe(client);
+ const close = () => {
+ client.destroy();
+ upstream.destroy();
+ };
+ client.on("error", close);
+ upstream.on("error", close);
+ })
+ .listen(Number(listenPort), "127.0.0.1");