continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
18.76k stars 1.59k forks source link

[CON-263] Unable to use @codebase search with continue.dev in vscode #2129

Closed AdiRishi closed 2 months ago

AdiRishi commented 2 months ago

Before submitting your bug report

Relevant environment info

- OS: MacOS Sonoma Version 14.6.1 (23G93)
- Continue: `v0.8.47`
- IDE: VSCode `1.92.2`
- Model: Ollama `0.3.8`
- config.json:

{
  "models": [
    {
      "title": "Llama3.1-8b",
      "model": "llama3.1:8b",
      "provider": "ollama"
    },
    {
      "title": "Llama3.1-40b",
      "model": "llama3.1:40b",
      "provider": "ollama"
    }
  ],
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
"tabAutocompleteModel": {
    "title": "starcoder2:7b",
    "model": "starcoder2:7b",
    "provider": "ollama"
  },
  "embeddingsProvider": {
    "provider": "ollama",
    "model": "nomic-embed-text"
  },
  "contextProviders": [
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    },
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "folder",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {}
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ]
}

Description

Whenever I run a query using the @codebase tag Continue is unable to retrieve any contextual information. It fails with the error - Error getting context items from codebase: TypeError: db.search is not a function

To reproduce

(Please note I both uninstalled the extension and ran rm -rf ~/.continue before reproducing this.

  1. Open the Continue.dev panel
  2. Ensure indexing is up to date (you can click the force index button to ensure this)
  3. Run @codebase tell me about this repo (or anything else with the @codebase tag
  4. It will fail.

Log output

One warning log

console.ts:137 [Extension Host] Error retrieving from FTS: Error: SQLITE_ERROR: no such table: fts
--> in Database#all('SELECT fts_metadata.chunkId, fts_metadata.path, fts.content, rank\n' +
  '    FROM fts\n' +
  '    JOIN fts_metadata ON fts.rowid = fts_metadata.id\n' +
  '    JOIN chunk_tags ON fts_metadata.chunkId = chunk_tags.chunkId\n' +
  `    WHERE fts MATCH '"give" OR "me" OR "an" OR "overview" OR "of" OR "this" OR "repo"' AND chunk_tags.tag IN (?)\n` +
  '      \n' +
  '    ORDER BY rank\n' +
  '    LIMIT ?', [ '/Users/adishwar.rishi/work/iss-webapp-api::develop::chunks', 1 ], [Function (anonymous)])
    at new Promise (<anonymous>)
y @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
B @ event.ts:1230
fire @ event.ts:1261
fire @ ipc.net.ts:652
K.onmessage @ localProcessExtensionHost.ts:378

One error log

notificationsAlerts.ts:42 Error getting context items from codebase: TypeError: db.search is not a function
c @ notificationsAlerts.ts:42
(anonymous) @ notificationsAlerts.ts:28
B @ event.ts:1230
C @ event.ts:1241
fire @ event.ts:1265
addNotification @ notifications.ts:228
notify @ notificationService.ts:253
(anonymous) @ mainThreadMessageService.ts:86
f @ mainThreadMessageService.ts:51
$showMessage @ mainThreadMessageService.ts:45
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
B @ event.ts:1230
fire @ event.ts:1261
fire @ ipc.net.ts:652
K.onmessage @ localProcessExtensionHost.ts:378

CON-263

Patrick-Erichsen commented 2 months ago

Hi @AdiRishi , thanks for the heads up on this, it should be resolved in the next release/pre-release.

SuperKevinZhang commented 2 months ago

Hi @Patrick-Erichsen 1:I also have this bug in vscode and idea, 2:When I use the codebase, the idea will be locked and cannot be used(window idea)

sestinj commented 2 months ago

Thanks for the update @SuperKevinZhang—I'm looking into this tomorrow, will let you know when I have updates

jbeoris commented 2 months ago

Can confirm that I experience the same issue. Would be amazing to have this fixed ASAP in pre-release.

cr-zhichen commented 2 months ago

I encountered the same issue in Rider, and the continue version number is: 0.0.64.

allenleexyz commented 2 months ago

Having the same issue

takacsv commented 2 months ago

Same issue in Visual Studio Code.

anrgct commented 2 months ago

1725027874660 @sestinj I'm sure it's this part of the code that's causing the problem

swiftsword94 commented 2 months ago

same issue here

dzivkovi commented 2 months ago

The same issue here, but @codebase directive worked until yesterday, when i mistakenly pasted some images into the prompt. Can it be related?

P.S. Also tried the old trick to force reindexing (rm -rf ~/.continue/index/) but the problem remains after VScode relaunch. I'm on Windows OS. P.P.S. How to escape '@' character in text blocks I sometimes have to paste into the prompt?

mreitschuster commented 2 months ago

same here. at all affected: in vscode -> extensions -> right click on continue extension -> install specific version -> select previous version

sestinj commented 2 months ago

@dzivkovi fixed the P.P.S. problem here, thanks for bringing that up

@anrgct thank you for pointing this out! Incredible that this slipped past me. Fix: https://github.com/continuedev/continue/commit/96f07dadc2a4627025656718cb6ae23a4d0b5db8

Shipping a new release in just a bit, will solve this issue!

SampaioLeal commented 2 months ago

just downloaded the extension and got the same error when i came here the fix was already cooked, nice :+1: edit: waiting for the release

corticalstack commented 2 months ago

Arrived at continue.dev from copilot and cursor, look fwd to the fix released, thanks!

AdiRishi commented 2 months ago

Just confirmed this is fixed in v0.8.48 for vscode. Thank you to the Continue team for the quick fix 🎉

jbeoris commented 1 month ago

Bless the continue.devs!

LucaSoato commented 1 month ago

Just FYI, the version 0.0.64 of Idea based IDEs is still affected by this bug.

mykolat commented 1 month ago

Just FYI, the version 0.0.64 of Idea based IDEs is still affected by this bug.

check out pre release version

https://docs.continue.dev/troubleshooting

Open JetBrains settings (cmd/ctrl+,) and go to "Plugins" Click the gear icon at the top Select "Manage Plugin Repositories..." Add "https://plugins.jetbrains.com/plugins/eap/list>" to the list