{"record":{"id":"241c9a3eae0cfdc8","repo":"deepseek-ai/deepseek-harness","slug":"agent-presets-cannot-read-preset-root-dir-s","errorCode":null,"errorMessage":"agent-presets: cannot read preset root ${dir}: ${String(error)}","messagePattern":"agent-presets: cannot read preset root (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/preset/agent-presets/src/discovery.ts","lineNumber":146,"sourceCode":" * not exist until the first locally authored preset, and naming a default\n * that no root supplies already fails loud at resolution.\n *\n * Every directory whose name is a usable preset id is a roster row — broken\n * when its composition is missing or unloadable. A directory named outside\n * {@link PRESET_ID} is skipped instead: no copy could ever claim that name,\n * so it blocks nothing, and reporting `.DS_Store`-grade residue as broken\n * presets would teach users to ignore the marker.\n * @param root - the directory and the trust its presets inherit.\n * @returns the root's presets ordered by id.\n */\nexport async function scanRoot(root: PresetRoot): Promise<AgentPreset[]> {\n  const dir = resolve(expandHomePath(root.path))\n  let children\n  try {\n    children = await readdir(dir, { withFileTypes: true })\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === 'ENOENT') return []\n    throw new Error(`agent-presets: cannot read preset root ${dir}: ${String(error)}`, { cause: error })\n  }\n  const found: AgentPreset[] = []\n  for (const child of children) {\n    if (!child.isDirectory() || !PRESET_ID.test(child.name)) continue\n    const directory = join(dir, child.name)\n    const path = join(directory, COMPOSITION_FILE)\n    const broken = await isFile(path)\n      ? await compositionProblem(path)\n      : `the composition file ${COMPOSITION_FILE} is missing — the directory still occupies the id; delete it or restore the file`\n    // Display text only, and never fatal: a preset with unreadable metadata\n    // still mounts, it just shows its id.\n    const metadata = await readPresetMetadata(directory)\n    found.push({\n      id: child.name, trust: root.trust, path, ...metadata,\n      ...broken === undefined ? {} : { broken },\n    })\n  }\n  // Declared order first so the shipped set reads by capability; everything","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/preset/agent-presets/src/discovery.ts#L128-L164","documentation":"Error \"agent-presets: cannot read preset root ${dir}: ${String(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/preset/agent-presets/src/discovery.ts:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the preset root path or its permissions per the included error."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}