From 0b492d9fbb3534cf357c23e92012b0a76cebf344 Mon Sep 17 00:00:00 2001 From: can1357 Date: Thu, 12 Feb 2026 15:10:17 +0100 Subject: [PATCH] fix(react-edit-benchmark): fixed incorrect path resolution for CLI module using Bun.fileURLToPath() - Fixed incorrect path resolution for CLI module by using Bun.fileURLToPath() to convert import.meta.resolve() result to a proper file path. - Reordered constant declarations to ensure TMP_DIR is initialized before CLI_PATH which depends on it. - Updated scripts/repro-stuck.ts to use consistent CLI path resolution with Bun.fileURLToPath(). --- packages/react-edit-benchmark/src/runner.ts | 3 +-- scripts/repro-stuck.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-edit-benchmark/src/runner.ts b/packages/react-edit-benchmark/src/runner.ts index b2335cb1e..2b3cf3d25 100644 --- a/packages/react-edit-benchmark/src/runner.ts +++ b/packages/react-edit-benchmark/src/runner.ts @@ -16,10 +16,9 @@ import benchmarkTaskPrompt from "./prompts/benchmark-task.md" with { type: "text import { type EditTask, extractTaskFiles } from "./tasks"; import { verifyExpectedFileSubset, verifyExpectedFiles } from "./verify"; -const CLI_PATH = import.meta.resolve("@oh-my-pi/pi-coding-agent/cli"); - const TMP_DIR = await TempDir.create("@reach-benchmark-"); const TMP = TMP_DIR.path(); +const CLI_PATH = Bun.fileURLToPath(import.meta.resolve("@oh-my-pi/pi-coding-agent/cli")); export interface BenchmarkConfig { provider: string; diff --git a/scripts/repro-stuck.ts b/scripts/repro-stuck.ts index 20cc41685..5872e0b8c 100644 --- a/scripts/repro-stuck.ts +++ b/scripts/repro-stuck.ts @@ -15,7 +15,7 @@ import { Subprocess } from "bun"; import * as path from "node:path"; -const CLI_PATH = path.resolve(import.meta.dir, "../packages/coding-agent/src/cli.ts"); +const CLI_PATH = Bun.fileURLToPath(import.meta.resolve("@oh-my-pi/pi-coding-agent/cli")); const TRACE_LOADER = path.resolve(import.meta.dir, "trace-loader.ts"); const POLL_INTERVAL = 200;