microsoft / microsoft/vscode

Copilot external ingest falls back to memory when workspace storage directory is absent

Open
#331,538 0 comments 0 reactions 1 assignee Claimed by @osortega View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Type: Bug

VS Code Stable 1.133.0 with bundled GitHub Copilot Chat 0.61.0 logs:

```text
Failed to create database. Falling back to in-memory db: Error: unable to open database file
```

The same construction remains on current main in Copilot Chat 0.63.0.

Cause:

`ExternalIngestIndex` joins `codebase-external.sqlite` onto `ExtensionContext.storageUri` and immediately passes the resulting path to `node:sqlite` `DatabaseSync`. The storage URI can be present while the extension-specific directory itself does not yet exist. SQLite can create the file but not its missing parent directory, so construction fails and the extension silently uses an in-memory index for that workspace.

This is distinct from permissions, corruption, and lock contention: the workspace-storage parent is writable, the extension-specific child is absent, and creating only that child makes the same bundled extension create and reopen the disk database successfully. Two cold starts then emitted no fallback, and both clean-close `PRAGMA integrity_check` runs returned `ok`.

Expected:

Before opening a file-backed external-ingest database, Copilot Chat should recursively create its declared file-scheme workspace-storage directory. A unit test should cover an absent nested storage directory and assert that `codebase-external.sqlite` is created there.

Related: #331190 includes the same database warning alongside a separate Windows extension-host crash, but this issue is limited to the deterministic missing-directory fallback.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.