{"record":{"id":"4d5d0c7c33bf3e01","repo":"can1357/oh-my-pi","slug":"terminal-bench-tasks-directory-does-not-exist-a","errorCode":null,"errorMessage":"Terminal-Bench tasks directory does not exist: ${absolute}","messagePattern":"Terminal-Bench tasks directory does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/metaharness/src/tb/dataset.ts","lineNumber":29,"sourceCode":"async function directoryStat(candidate: string): Promise<\"directory\" | \"other\" | \"missing\"> {\n\ttry {\n\t\treturn (await fs.stat(candidate)).isDirectory() ? \"directory\" : \"other\";\n\t} catch (error) {\n\t\tif (isEnoent(error)) return \"missing\";\n\t\tthrow error;\n\t}\n}\n\nasync function validateTasksDir(tasksDir: string): Promise<string> {\n\tconst absolute = path.resolve(tasksDir);\n\ttry {\n\t\tconst entries = await fs.readdir(absolute, { withFileTypes: true });\n\t\tfor (const entry of entries) {\n\t\t\tif (!entry.isDirectory()) continue;\n\t\t\tif (await Bun.file(path.join(absolute, entry.name, \"task.toml\")).exists()) return absolute;\n\t\t}\n\t} catch (error) {\n\t\tif (isEnoent(error)) throw new Error(`Terminal-Bench tasks directory does not exist: ${absolute}`);\n\t\tthrow error;\n\t}\n\tthrow new Error(`Terminal-Bench tasks directory contains no task.toml files: ${absolute}`);\n}\n\nfunction repositoryName(source: string): string {\n\tconst trimmed = source.replace(/\\/+$/, \"\");\n\tconst basename = trimmed.slice(trimmed.lastIndexOf(\"/\") + 1).replace(/\\.git$/, \"\");\n\tif (!basename) throw new Error(`Cannot determine repository name from dataset source: ${source}`);\n\treturn basename;\n}\n\nfunction gitError(action: string, source: string, stderr: Uint8Array): Error {\n\tconst detail = new TextDecoder().decode(stderr).trim();\n\treturn new Error(`${action} ${source} failed${detail ? `: ${detail}` : \"\"}`);\n}\n\nexport async function resolveDataset(source: string, cacheDir: string): Promise<string> {","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/src/tb/dataset.ts#L11-L47","documentation":"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.","triggerScenarios":"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.","commonSituations":"Typo in --dataset path; cache directory cleared between runs; relative path resolved from a different working directory; dataset checkout removed by a clean step.","solutions":["Check the path exists: ls <dataset-path> and fix typos","Re-clone/re-download the dataset or point --dataset at an existing checkout","Run from the intended working directory or use an absolute path"],"exampleFix":"// before\nresolveDataset(\"./tb-datasets/tasks-v1\") // deleted\n// after\nresolveDataset(\"/data/terminal-bench/tasks\") // exists with */task.toml","handlingStrategy":"validation","validationCode":"import { stat } from \"node:fs/promises\";\ntry { await stat(datasetPath); } catch { throw new Error(`Dataset path does not exist: ${datasetPath}`); }","typeGuard":null,"tryCatchPattern":"try {\n  await resolveDataset(source, cacheDir);\n} catch (err) {\n  if (String(err.message).includes(\"does not exist\")) {\n    console.error(`Dataset missing at ${source}; re-clone or fix --dataset.`);\n  }\n  throw err;\n}","preventionTips":["Use absolute paths for datasets","Confirm the checkout exists before runs (CI: cache/restore step)","Don't clean dataset caches mid-pipeline"],"tags":["filesystem","missing-directory","dataset"],"backgroundTag":"directory-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}