Skip to content

Commit 98e46d6

Browse files
committed
🤖 fix: repair terminal-bench agent path and source execution
Updates mux-run.sh to point to correct src/cli/debug/agentSessionCli.ts path. Updates workerPool.ts to support running tokenizer worker from source (Bun) when dist is missing. Updates benchmarking docs to reflect correct path.
1 parent 7ba4d15 commit 98e46d6

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

benchmarks/terminal_bench/mux-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ensure_git_repo "${project_path}"
7777
log "starting mux agent session for ${project_path}"
7878
cd "${MUX_APP_ROOT}"
7979

80-
cmd=(bun src/debug/agentSessionCli.ts
80+
cmd=(bun src/cli/debug/agentSessionCli.ts
8181
--config-root "${MUX_CONFIG_ROOT}"
8282
--project-path "${project_path}"
8383
--workspace-path "${project_path}"

docs/benchmarking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The adapter lives in `benchmarks/terminal_bench/mux_agent.py`. For each task it:
6565

6666
1. Copies the mux repository (package manifests + `src/`) into `/tmp/mux-app` inside the container.
6767
2. Ensures Bun exists, then runs `bun install --frozen-lockfile`.
68-
3. Launches `src/debug/agentSessionCli.ts` to prepare workspace metadata and stream the instruction, storing state under `MUX_CONFIG_ROOT` (default `/root/.mux`).
68+
3. Launches `src/cli/debug/agentSessionCli.ts` to prepare workspace metadata and stream the instruction, storing state under `MUX_CONFIG_ROOT` (default `/root/.mux`).
6969

7070
`MUX_MODEL` accepts either the mux colon form (`anthropic:claude-sonnet-4-5`) or the Terminal-Bench slash form (`anthropic/claude-sonnet-4-5`); the adapter normalises whichever you provide.
7171

src/node/utils/main/workerPool.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Worker } from "node:worker_threads";
2-
import { join, dirname, sep } from "node:path";
2+
import { join, dirname, sep, extname } from "node:path";
33

44
interface WorkerRequest {
55
messageId: number;
@@ -37,15 +37,21 @@ const hasDist = pathParts.includes("dist");
3737
const srcIndex = pathParts.lastIndexOf("src");
3838

3939
let workerDir: string;
40-
if (srcIndex !== -1 && !hasDist) {
40+
let workerFile = "tokenizer.worker.js";
41+
42+
if (extname(__filename) === ".ts") {
43+
// Running from source (e.g. via Bun)
44+
workerDir = currentDir;
45+
workerFile = "tokenizer.worker.ts";
46+
} else if (srcIndex !== -1 && !hasDist) {
4147
// Replace 'src' with 'dist' in the path (only if not already in dist)
4248
pathParts[srcIndex] = "dist";
4349
workerDir = pathParts.join(sep);
4450
} else {
4551
workerDir = currentDir;
4652
}
4753

48-
const workerPath = join(workerDir, "tokenizer.worker.js");
54+
const workerPath = join(workerDir, workerFile);
4955
const worker = new Worker(workerPath);
5056

5157
// Handle messages from worker

0 commit comments

Comments
 (0)