Skip to content

Conversation

@markijbema
Copy link
Contributor

This commit reverts PR #3533 which disabled NewAutocompleteProvider due to SQLite bundling issues. The proper fix is to bundle SQLite native binaries following Continue's approach.

Changes:

  • Restored NewAutocompleteProvider in GhostServiceManager.ts
  • Added .node loader to esbuild.mjs to handle native binary modules
  • Added build step to copy sqlite3 and sqlite modules to dist/node_modules/
  • Updated .vscodeignore to include SQLite modules in VSIX package
  • Fixed sqlite3 mock in AutocompleteLruCache.spec.ts to include default export

The extension will now properly load SQLite at runtime from the bundled node_modules, allowing NewAutocompleteProvider to work in production.

Context

Implementation

Screenshots

before after

How to Test

Get in Touch

@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2025

⚠️ No Changeset found

Latest commit: 7ea1405

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@markijbema markijbema force-pushed the mark/sqlite branch 2 times, most recently from 554660d to f6a9d92 Compare November 6, 2025 14:12
<Bot className="w-4" />
<div>{t("kilocode:ghost.title")}</div>
</div>
IK BEN MARK
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for debugging; todo: remove

This commit reverts PR #3533 which disabled NewAutocompleteProvider due to
SQLite bundling issues. The proper fix is to bundle SQLite native binaries
following Continue's approach.

Changes:
- Restored NewAutocompleteProvider in GhostServiceManager.ts
- Added .node loader to esbuild.mjs to handle native binary modules
- Added build step to copy sqlite3 and sqlite modules to dist/node_modules/
- Updated .vscodeignore to include SQLite modules in VSIX package
- Fixed sqlite3 mock in AutocompleteLruCache.spec.ts to include default export

The extension will now properly load SQLite at runtime from the bundled
node_modules, allowing NewAutocompleteProvider to work in production.
@markijbema markijbema marked this pull request as ready for review November 6, 2025 15:39
@chrarnoldus
Copy link
Collaborator

VSIX size appears to increase from 31 => 39 MB
Continue appears to be 111MB

Comment on lines +82 to +95
// Fallback: try to find it in pnpm structure
const pnpmDir = path.join(srcDir, "../node_modules/.pnpm")
if (fs.existsSync(pnpmDir)) {
const entries = fs.readdirSync(pnpmDir)
for (const entry of entries) {
if (entry.startsWith(`${packageName}@`)) {
const packagePath = path.join(pnpmDir, entry, "node_modules", packageName)
if (fs.existsSync(packagePath)) {
packageSource = packagePath
break
}
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we care about this fallback or should we just fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3/4 packages use the fallback

Comment on lines +117 to +118
copyPackage("sqlite3")
copyPackage("sqlite")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, though I'm not sure why

@markijbema
Copy link
Contributor Author

Only works on mac with this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants