{"record":{"id":"73e89402afe9de89","repo":"can1357/oh-my-pi","slug":"terminal-bench-tasks-directory-contains-no-task-to","errorCode":null,"errorMessage":"Terminal-Bench tasks directory contains no task.toml files: ${absolute}","messagePattern":"Terminal-Bench tasks directory contains no task\\.toml files: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/metaharness/src/tb/dataset.ts","lineNumber":32,"sourceCode":"\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> {\n\tconst sourceKind = await directoryStat(source);\n\tif (sourceKind === \"directory\") {\n\t\tconst absoluteSource = path.resolve(source);","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/src/tb/dataset.ts#L14-L50","documentation":"validateTasksDir also throws when the directory exists and is readable but none of its immediate subdirectories contain a task.toml file — meaning it is not a Terminal-Bench tasks root (you may have pointed at the repo root instead of its tasks/ folder, or at the wrong checkout level).","triggerScenarios":"resolveDataset passes a directory whose child directories all lack task.toml, e.g. pointing at a Terminal-Bench repo root instead of tasks/, or a checkout of a different project.","commonSituations":"Dataset dir has an unexpected layout after upstream restructure; user passed a parent directory; empty cloned repo (shallow/failed checkout with no task subdirs).","solutions":["Point --dataset at the directory whose subdirectories each contain task.toml (often <repo>/tasks)","Verify the cloned repo is intact (git status; non-empty tasks/) and re-clone if needed","If layout changed upstream, pass the nested tasks path explicitly (resolveDataset already tries <dir>/tasks)"],"exampleFix":"// before\n--dataset ~/terminal-bench          # repo root, no */task.toml\n// after\n--dataset ~/terminal-bench/tasks    # contains hello-world/task.toml ...","handlingStrategy":"validation","validationCode":"import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nconst entries = await fs.readdir(dir, { withFileTypes: true });\nconst hasTask = entries.some(async e => e.isDirectory() && await Bun.file(path.join(dir, e.name, \"task.toml\")).exists());\nif (!hasTask) throw new Error(`${dir} has no */task.toml`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point --dataset at the tasks/ root containing per-task task.toml files","Spot-check the checkout layout after upstream updates","Re-clone if the repo appears empty or restructured"],"tags":["filesystem","dataset","invalid-layout"],"backgroundTag":"missing-task-manifest","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}