Skip to content

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

fix(bench): correct viewer server port binding

Steven Enamakel68ae03df0d85
diff --git a/bench/harnesses/viewer/server.mjs b/bench/harnesses/viewer/server.mjs
index e3f52be682..4a64902673 100644
--- a/bench/harnesses/viewer/server.mjs
+++ b/bench/harnesses/viewer/server.mjs
@@ -120,8 +120,10 @@ const routes = [
const tasks = dirs(capDir(run, h.harness));
const t = tasks.sort()[0];
if (!t) continue;
- const first = fs.readdirSync(capDir(run, h.harness, t)).sort()[0];
- const c = readJson(path.join(capDir(run, h.harness, t), first));
+ // The main agent request, not a tool-less side call (e.g. a title generator) that may open the task.
+ const calls = fs.readdirSync(capDir(run, h.harness, t)).sort().map((f) => readJson(path.join(capDir(run, h.harness, t), f)));
+ const size = (x) => (x.tool_count ?? 0) * 1e6 + (x.system_chars ?? 0);
+ const c = calls.reduce((best, x) => (size(x) > size(best) ? x : best), calls[0]);
h.system_sha = c.system_sha;
h.system_chars = c.system_chars;
h.sample_task = t;