{"record":{"id":"2cb4e875d9140f4b","repo":"diegosouzapw/OmniRoute","slug":"local-corpus-is-not-configured-set-a-root-in-sett","errorCode":null,"errorMessage":"Local corpus is not configured. Set a root in Settings > Context Sources","messagePattern":"Local corpus is not configured\\. Set a root in Settings > Context Sources","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/localCorpus/configured.ts","lineNumber":15,"sourceCode":"import { getLocalCorpusRoot } from \"../db/localCorpus\";\nimport { getDefaultLocalCorpusStatus, LocalCorpusIndex } from \"./index\";\n\nlet sharedRoot: string | null = null;\nlet sharedIndex: LocalCorpusIndex | null = null;\n\nexport function resetLocalCorpusIndex(): void {\n  sharedRoot = null;\n  sharedIndex = null;\n}\n\nfunction getConfiguredIndex(): LocalCorpusIndex {\n  const rootPath = getLocalCorpusRoot();\n  if (!rootPath) {\n    throw new Error(\"Local corpus is not configured. Set a root in Settings > Context Sources\");\n  }\n  if (!sharedIndex || sharedRoot !== rootPath) {\n    sharedRoot = rootPath;\n    sharedIndex = new LocalCorpusIndex(rootPath);\n  }\n  return sharedIndex;\n}\n\nexport function getConfiguredLocalCorpusStatus() {\n  return getLocalCorpusRoot() ? getConfiguredIndex().getStatus() : getDefaultLocalCorpusStatus();\n}\n\nexport async function searchConfiguredLocalCorpus(\n  query: string,\n  options: { limit?: number; refresh?: boolean } = {}\n) {\n  return getConfiguredIndex().search(query, options);\n}","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/localCorpus/configured.ts#L1-L33","documentation":"Error \"Local corpus is not configured. Set a root in Settings > Context Sources\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/localCorpus/configured.ts:15 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}