{"record":{"id":"c5720ccb7abe5ec7","repo":"JuliusBrussee/caveman","slug":"aider-config-uses-inline-scalar-read-use-block-li","errorCode":null,"errorMessage":"Aider config uses inline/scalar read; use block-list form before enabling Caveman","messagePattern":"Aider config uses inline/scalar read; use block-list form before enabling Caveman","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/index.ts","lineNumber":7431,"sourceCode":"  const lines = source.replace(/\\r\\n/g, \"\\n\").split(\"\\n\");\n  const routeIndexes = lines.flatMap((line, index) => /^openai-api-base\\s*:/.test(line) ? [index] : []);\n  if (routeIndexes.length > 1) throw new Error(\"Aider config has duplicate openai-api-base keys; refusing unsafe merge\");\n  const routeBlockLines = [AIDER_NATIVE_ROUTE_BEGIN, `openai-api-base: ${yamlQuote(route)}`, AIDER_NATIVE_ROUTE_END];\n  const routeBlock = routeBlockLines.join(newline);\n  const previousRouteLine = routeIndexes.length === 1 ? lines[routeIndexes[0]!]! : null;\n  if (routeIndexes.length === 1) lines.splice(routeIndexes[0]!, 1, ...routeBlockLines);\n  else {\n    if (lines.some((line) => line.trim() !== \"\") && lines[lines.length - 1]?.trim()) lines.push(\"\");\n    lines.push(...routeBlockLines);\n  }\n\n  const readIndexes = lines.flatMap((line, index) => /^read\\s*:/.test(line) ? [index] : []);\n  if (readIndexes.length > 1) throw new Error(\"Aider config has duplicate read keys; refusing unsafe merge\");\n  let readBlockLines: string[];\n  if (readIndexes.length === 1) {\n    const readIndex = readIndexes[0]!;\n    if (!/^read\\s*:\\s*(?:#.*)?$/.test(lines[readIndex]!)) {\n      throw new Error(\"Aider config uses inline/scalar read; use block-list form before enabling Caveman\");\n    }\n    let end = readIndex + 1;\n    while (end < lines.length && !/^[A-Za-z0-9][A-Za-z0-9_-]*\\s*:/.test(lines[end]!)) end++;\n    readBlockLines = [`  ${AIDER_NATIVE_READ_BEGIN}`, `  - ${yamlQuote(corePath)}`, `  ${AIDER_NATIVE_READ_END}`];\n    lines.splice(end, 0, ...readBlockLines);\n  } else {\n    if (lines.some((line) => line.trim() !== \"\") && lines[lines.length - 1]?.trim()) lines.push(\"\");\n    readBlockLines = [AIDER_NATIVE_READ_BEGIN, \"read:\", `  - ${yamlQuote(corePath)}`, AIDER_NATIVE_READ_END];\n    lines.push(...readBlockLines);\n  }\n  const readBlock = readBlockLines.join(newline);\n  const text = lines.join(newline).replace(/(?:\\r?\\n)+$/, \"\") + newline;\n  return { text, routeBlock, previousRouteLine, readBlock };\n}\n\nfunction aiderNativeMutations(gw: string): NativeMutation[] {\n  const configPath = join(homedir(), \".aider.conf.yml\");\n  const configBefore = fileBytes(configPath);","sourceCodeStart":7413,"sourceCodeEnd":7449,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/cli/src/index.ts#L7413-L7449","documentation":"aiderNativeConfig() can only append the Caveman core path to a `read:` key that uses YAML block-list form (`read:` with nothing or a comment after the colon). If the config uses an inline/scalar form such as `read: foo.md`, the installer cannot safely splice entries and asks the user to convert it to block-list form first.","triggerScenarios":"Enabling Caveman for Aider when ~/.aider.conf.yml contains exactly one `read:` line but it has an inline value, e.g. `read: instructions.md` or `read: [a.md, b.md]`.","commonSituations":"Users who wrote a compact one-line read config; older Aider examples/docs showing scalar `read:`; configs converted from other tools' formats that use inline lists.","solutions":["Convert the inline/scalar `read:` to block-list form in ~/.aider.conf.yml (one `- path` item per line, indented).","Re-run the Caveman enable command after the conversion.","If a list of files exists inline, expand each element into its own `- ` line under `read:`."],"exampleFix":"// before\nread: instructions.md\n// after\nread:\n  - instructions.md","handlingStrategy":"validation","validationCode":"const lines = readFileSync(aiderCfg, 'utf8').split('\\n');\nconst idx = lines.findIndex((l) => /^read\\s*:/.test(l));\nif (idx !== -1 && !/^read\\s*:\\s*(?:#.*)?$/.test(lines[idx])) {\n  // convert `read: value` to block-list form before enabling\n}","typeGuard":null,"tryCatchPattern":"try {\n  await cavemanEnableAider();\n} catch (e) {\n  if (String(e.message).includes('inline/scalar read')) {\n    convertReadToBlockList(aiderCfg);\n    await cavemanEnableAider();\n  }\n}","preventionTips":["Always use block-list form for `read:` in ~/.aider.conf.yml.","Avoid `read: file.md` scalar shorthand; write `- file.md` under `read:`.","Expand inline arrays (`read: [a, b]`) into block lists.","Check the Caveman Aider docs for the expected config shape before enabling."],"tags":["aider","config","yaml","format"],"backgroundTag":"conflicting-config-options","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}