Fix evals

This commit is contained in:
cte 2026-01-16 22:37:17 -08:00
parent e41438faaf
commit dc7579f63d

View file

@ -1,4 +1,3 @@
import * as fs from "fs"
import * as path from "path"
import * as os from "node:os"
@ -20,7 +19,7 @@ import { mergeToolUsage, waitForSubprocessWithTimeout } from "./utils.js"
*/
export const runTaskWithCli = async ({ run, task, publish, logger, jobToken }: RunTaskOptions) => {
const { language, exercise } = task
const prompt = fs.readFileSync(path.resolve(EVALS_REPO_PATH, `prompts/${language}.md`), "utf-8")
const promptSourcePath = path.resolve(EVALS_REPO_PATH, `prompts/${language}.md`)
const workspacePath = path.resolve(EVALS_REPO_PATH, language, exercise)
const ipcSocketPath = path.resolve(os.tmpdir(), `evals-cli-${run.id}-${task.id}.sock`)
@ -36,7 +35,19 @@ export const runTaskWithCli = async ({ run, task, publish, logger, jobToken }: R
const controller = new AbortController()
const cancelSignal = controller.signal
const cliArgs = ["--filter", "@roo-code/cli", "start", "--yes", "--print", "--reasoning-effort", "disabled"]
const cliArgs = [
"--filter",
"@roo-code/cli",
"start",
"--prompt-file",
promptSourcePath,
"--workspace",
workspacePath,
"--yes",
"--reasoning-effort",
"disabled",
"--oneshot",
]
if (run.settings?.mode) {
cliArgs.push("--mode", run.settings.mode)
@ -52,11 +63,8 @@ export const runTaskWithCli = async ({ run, task, publish, logger, jobToken }: R
cliArgs.push("--model", modelId)
}
cliArgs.push(prompt)
logger.info(`CLI command: pnpm ${cliArgs.join(" ")}`)
const subprocess = execa("pnpm", cliArgs, { env, cancelSignal, cwd: workspacePath })
const subprocess = execa("pnpm", cliArgs, { env, cancelSignal, cwd: process.cwd() })
// Buffer for accumulating streaming output until we have complete lines.
let stdoutBuffer = ""