continuedev/continue · warning · Error
No workspace directories found
Error message
No workspace directories found
What it means
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.
Source
Thrown at core/context/retrieval/retrieval.ts:31
options: any | undefined,
filterDirectory: string | undefined,
): Promise<ContextItem[]> {
// Currently you can use codebase without an embeddings provider and it will just skip the embeddings inputs
// if (!extras.embeddingsProvider) {
// void extras.ide.showToast(
// "warning",
// "Set up an embeddings model to use this feature. Visit the docs to learn more: " +
// "https://docs.continue.dev/customize/model-roles/embeddings",
// );
// return [];
// }
const includeEmbeddings = !!extras.config.selectedModelByRole.embed;
// Get tags to retrieve for
const workspaceDirs = await extras.ide.getWorkspaceDirs();
if (workspaceDirs.length === 0) {
throw new Error("No workspace directories found");
}
// Fill half of the context length, up to a max of 100 snippets
const contextLength = extras.llm.contextLength;
const tokensPerSnippet = 512;
const nFinal =
options?.nFinal ??
Math.min(DEFAULT_N_FINAL, contextLength / tokensPerSnippet / 2);
const useReranking = options?.useReranking ?? !!extras.reranker;
const nRetrieve = useReranking ? options?.nRetrieve || 2 * nFinal : nFinal;
const branches = (await Promise.race([
Promise.all(workspaceDirs.map((dir) => extras.ide.getBranch(dir))),
new Promise((resolve) => {
setTimeout(() => {
resolve(["NONE"]);
}, 500);
}),View on GitHub (pinned to 5522c6f44c)
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
Defensive patterns
Strategy: validation
Validate before calling
const dirs = await ide.getWorkspaceDirs();
if (dirs.length === 0) { informUser('Open a folder to use @codebase'); return []; } Prevention
- Require an open workspace before offering embeddings-based retrieval
- Handle empty workspace gracefully in UI instead of throwing
When it happens
Trigger: Invoking @codebase or any embeddings retrieval when ide.getWorkspaceDirs() returns []: no folder open, blank window, or workspace with no local roots.
Common situations: Running Continue in a single-file/untitled window; remote workspaces where directory listing fails; extension started before a folder was opened.
Related errors
- Failed to determine the workspace directory.
- Failed to fetch messages: ${response.statusText}
- No reranker set up
- await resp.text()
- await resp.text()
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/b3bd88262fa4b481.
Report an issue: GitHub.