continue icon indicating copy to clipboard operation
continue copied to clipboard

LanceDb/indexing issue

Open nmcostello opened this issue 9 months ago • 6 comments

Before submitting your bug report

Relevant environment info

- OS: macOS 14.4.1
- Continue: main
- IDE: vscode

Description

When building from the main branch in the vscode debugger, no lancedb is created within the .continue directory. This leads to indexing issues when the @Docs or @Codebase contexts are used.

Downloading an older version, leaving the .continue directory alone, then installing main again works because .continue/index/lancedb already exists in that scenario.

To reproduce

  1. Remove all references to .continue on your environment.
  2. Run Task install-dependancies and run VSCode Debugger in main.
  3. Verify LanceDB directory doesn't show up at .continue/index/lancedb.
  4. Run @Docs or @Codebase.
  5. Get an error popup and failure to index.

Log output

Error refreshing index:  TypeError: failed to downcast any to Array
	at Object.connect (.../continue/core/node_modules/vectordb/src/index.ts:195:20)
	at _LanceDbIndex.update (.../continue/core/indexing/LanceDbIndex.ts:141:30)
	at async CodebaseIndexer.refresh (.../continue/core/indexing/indexCodebase.ts:104:43)
	at async _VsCodeExtension.refreshCodebaseIndex (.../continue/extensions/vscode/out/extension.js:331802:26) {stack: 'TypeError: failed to downcast any to Array
	a…extensions/vscode/out/extension.js:331802:26)', message: 'failed to downcast any to Array'}

nmcostello avatar May 02 '24 13:05 nmcostello

@nmcostello thanks for making an issue for this—I've been seeing it the last couple of days in the preview branch as well, but oddly not in production. I've not yet confirmed that it doesn't happen after packaging, but that seems to be the case.

Probably a git bisect will reveal the offending commit (assuming there is one)

sestinj avatar May 02 '24 20:05 sestinj

I am seeing this issue as well -- even after packaging and installing the extension (built from source).

spew avatar May 06 '24 23:05 spew

@spew @sestinj We fixed the issue today by doing a few things:

  1. Delete core/package-lock.json and extensions/vscode/package-lock.json
  2. Modify the vectordb entry in both core/package.json and extensions/vscode/package.json:
      "dependencies": {
    -   "vectordb": "0.4.12",
    +   "vectordb": "^0.4.12",
    }
    
  3. Run install-dependencies.sh (via command line or VSCode tasks)
  4. Install .vsix or run the debugger

Edit: I ran git clean -fdX and removed any uncommited code before doing all of this. I don't know if that was necessary or not I just wanted to start from a clean slate.

nmcostello avatar May 07 '24 00:05 nmcostello

Definitely happening with me. I've been seeing it for a few days.

kivo360 avatar May 07 '24 06:05 kivo360

@nmcostello thanks for sharing the fix. Will try and get this integrated today

sestinj avatar May 07 '24 21:05 sestinj

Confirming that switching back to ^0.4.12 solves the issue (https://github.com/continuedev/continue/commit/3749a8cc40a885ac845ea36a281df517785435bf).

The original reason for pinning to 0.4.12 was this, which is now fixed, so the change is safe.

I'm making a release for 0.9.127 right now, but I'll leave this issue for a couple of days to confirm that the new version solves the problem

sestinj avatar May 07 '24 23:05 sestinj