can1357/oh-my-pi · error

Terminal-Bench tasks directory does not exist: ${absolute}

Error message

Terminal-Bench tasks directory does not exist: ${absolute}

What it means

validateTasksDir confirms a resolved directory is a Terminal-Bench tasks directory by looking for subdirectories containing task.toml. If the directory itself cannot be read because it does not exist (ENOENT), this error replaces the raw filesystem error with a clear message.

Source

Thrown at packages/metaharness/src/tb/dataset.ts:29

async function directoryStat(candidate: string): Promise<"directory" | "other" | "missing"> {
	try {
		return (await fs.stat(candidate)).isDirectory() ? "directory" : "other";
	} catch (error) {
		if (isEnoent(error)) return "missing";
		throw error;
	}
}

async function validateTasksDir(tasksDir: string): Promise<string> {
	const absolute = path.resolve(tasksDir);
	try {
		const entries = await fs.readdir(absolute, { withFileTypes: true });
		for (const entry of entries) {
			if (!entry.isDirectory()) continue;
			if (await Bun.file(path.join(absolute, entry.name, "task.toml")).exists()) return absolute;
		}
	} catch (error) {
		if (isEnoent(error)) throw new Error(`Terminal-Bench tasks directory does not exist: ${absolute}`);
		throw error;
	}
	throw new Error(`Terminal-Bench tasks directory contains no task.toml files: ${absolute}`);
}

function repositoryName(source: string): string {
	const trimmed = source.replace(/\/+$/, "");
	const basename = trimmed.slice(trimmed.lastIndexOf("/") + 1).replace(/\.git$/, "");
	if (!basename) throw new Error(`Cannot determine repository name from dataset source: ${source}`);
	return basename;
}

function gitError(action: string, source: string, stderr: Uint8Array): Error {
	const detail = new TextDecoder().decode(stderr).trim();
	return new Error(`${action} ${source} failed${detail ? `: ${detail}` : ""}`);
}

export async function resolveDataset(source: string, cacheDir: string): Promise<string> {

View on GitHub (pinned to 9690622007)

Solutions

  1. Check the path exists: ls <dataset-path> and fix typos
  2. Re-clone/re-download the dataset or point --dataset at an existing checkout
  3. Run from the intended working directory or use an absolute path

Example fix

// before
resolveDataset("./tb-datasets/tasks-v1") // deleted
// after
resolveDataset("/data/terminal-bench/tasks") // exists with */task.toml
Defensive patterns

Strategy: validation

Validate before calling

import { stat } from "node:fs/promises";
try { await stat(datasetPath); } catch { throw new Error(`Dataset path does not exist: ${datasetPath}`); }

Try / catch

try {
  await resolveDataset(source, cacheDir);
} catch (err) {
  if (String(err.message).includes("does not exist")) {
    console.error(`Dataset missing at ${source}; re-clone or fix --dataset.`);
  }
  throw err;
}

Prevention

When it happens

Trigger: resolveDataset calls validateTasksDir with a path whose readdir raises ENOENT — i.e. the configured dataset directory (or its nested tasks/ subdir) was deleted, never cloned, or the path is wrong.

Common situations: Typo in --dataset path; cache directory cleared between runs; relative path resolved from a different working directory; dataset checkout removed by a clean step.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/4d5d0c7c33bf3e01. Report an issue: GitHub.