{"record":{"id":"b3bd88262fa4b481","repo":"continuedev/continue","slug":"no-workspace-directories-found","errorCode":null,"errorMessage":"No workspace directories found","messagePattern":"No workspace directories found","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"core/context/retrieval/retrieval.ts","lineNumber":31,"sourceCode":"  options: any | undefined,\n  filterDirectory: string | undefined,\n): Promise<ContextItem[]> {\n  // Currently you can use codebase without an embeddings provider and it will just skip the embeddings inputs\n  // if (!extras.embeddingsProvider) {\n  //   void extras.ide.showToast(\n  //     \"warning\",\n  //     \"Set up an embeddings model to use this feature. Visit the docs to learn more: \" +\n  //       \"https://docs.continue.dev/customize/model-roles/embeddings\",\n  //   );\n  //   return [];\n  // }\n  const includeEmbeddings = !!extras.config.selectedModelByRole.embed;\n\n  // Get tags to retrieve for\n  const workspaceDirs = await extras.ide.getWorkspaceDirs();\n\n  if (workspaceDirs.length === 0) {\n    throw new Error(\"No workspace directories found\");\n  }\n\n  // Fill half of the context length, up to a max of 100 snippets\n  const contextLength = extras.llm.contextLength;\n  const tokensPerSnippet = 512;\n  const nFinal =\n    options?.nFinal ??\n    Math.min(DEFAULT_N_FINAL, contextLength / tokensPerSnippet / 2);\n  const useReranking = options?.useReranking ?? !!extras.reranker;\n  const nRetrieve = useReranking ? options?.nRetrieve || 2 * nFinal : nFinal;\n\n  const branches = (await Promise.race([\n    Promise.all(workspaceDirs.map((dir) => extras.ide.getBranch(dir))),\n    new Promise((resolve) => {\n      setTimeout(() => {\n        resolve([\"NONE\"]);\n      }, 500);\n    }),","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/retrieval/retrieval.ts#L13-L49","documentation":"retrieveContextItemsFromEmbeddings asks the IDE for workspace directories and throws if the list is empty: with no open folder there is nothing to index or retrieve from, so @codebase / embeddings-based retrieval cannot run.","triggerScenarios":"Invoking @codebase or any embeddings retrieval when ide.getWorkspaceDirs() returns []: no folder open, blank window, or workspace with no local roots.","commonSituations":"Running Continue in a single-file/untitled window; remote workspaces where directory listing fails; extension started before a folder was opened.","solutions":["Open a local folder as the workspace and retry @codebase","Ensure the folder is a real directory the extension can enumerate (not an empty ad-hoc workspace)","Reload the window after opening the folder so the backend re-queries workspace dirs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const dirs = await ide.getWorkspaceDirs();\nif (dirs.length === 0) { informUser('Open a folder to use @codebase'); return []; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require an open workspace before offering embeddings-based retrieval","Handle empty workspace gracefully in UI instead of throwing"],"tags":["retrieval","embeddings","workspace","ide"],"backgroundTag":"no-workspace-directory","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}