The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore(bench): update meter-proxy and report harnesses
Steven Enamakel159fc09f060a
diff --git a/bench/harnesses/meter-proxy/proxy.mjs b/bench/harnesses/meter-proxy/proxy.mjsindex 109a78f5c5..aabe54cc69 100644--- a/bench/harnesses/meter-proxy/proxy.mjs+++ b/bench/harnesses/meter-proxy/proxy.mjs@@ -84,17 +84,33 @@ export function createProxy(opts) {fs.appendFileSync(logPath, `${JSON.stringify(record)}\n`);}+ // Tokenising is the one costly step, and a task resends the same system prompt and tool+ // schemas every turn, so count each distinct text once.+ const tokenMemo = new Map();+ function tokens(text) {+ if (!text) return 0;+ let n = tokenMemo.get(text);+ if (n === undefined) {+ if (tokenMemo.size > 64) tokenMemo.clear();+ n = countTokens(text);+ tokenMemo.set(text, n);+ }+ return n;+ }++ // Sized on every call, not just the first: some harnesses open a task with a small side+ // request (OpenCode's title generator has no tools), and the report needs to find the+ // main agent request, the one with the largest static prompt.function promptSizes(format, body) {const key = `${run.run_id}/${run.harness}/${run.task}`;- if (firstRequests.has(key)) return null;const parts = extractPromptParts(format, body);const sizes = {- system_prompt_tokens: countTokens(parts.system),- tool_schema_tokens: parts.tools ? countTokens(parts.tools) : 0,+ system_prompt_tokens: tokens(parts.system),+ tool_schema_tokens: tokens(parts.tools),tool_count: parts.tool_count,tokenizer,};- firstRequests.set(key, sizes);+ if (!firstRequests.has(key)) firstRequests.set(key, sizes);return sizes;}diff --git a/bench/harnesses/report.mjs b/bench/harnesses/report.mjsindex 5d7a38dba2..01a60ec0ac 100644--- a/bench/harnesses/report.mjs+++ b/bench/harnesses/report.mjs@@ -29,6 +29,21 @@ const mean = (xs) => {* @param tasks [{harness, task_key, task, result, grade}] one per executed task* @returns {[harness]: metrics}*/+/**+ * The request that carries a task's real static prompt: the call with the largest system prompt+ * plus tool schemas. Usually the first call, but some harnesses open with a small tool-less side+ * request (OpenCode's title generator), which would otherwise read as "no tools".+ */+export function mainRequest(calls, taskKey) {+ const size = (r) => (r.system_prompt_tokens ?? 0) + (r.tool_schema_tokens ?? 0);+ let best = null;+ for (const r of calls) {+ if (r.task !== taskKey || r.system_prompt_tokens == null) continue;+ if (best === null || size(r) > size(best)) best = r;+ }+ return best;+}+export function aggregate(meter, tasks) {const harnesses = [...new Set(tasks.map((t) => t.harness))];const out = {};@@ -37,9 +52,7 @@ export function aggregate(meter, tasks) {const calls = meter.filter((r) => r.harness === harness);const ok = calls.filter((r) => r.status >= 200 && r.status < 300);- const firstCalls = mine- .map((t) => calls.find((r) => r.task === t.task_key && r.system_prompt_tokens != null))- .filter(Boolean);+ const firstCalls = mine.map((t) => mainRequest(calls, t.task_key)).filter(Boolean);const coldStart = mine.map((t) => {const first = calls.find((r) => r.task === t.task_key);