chatbox icon indicating copy to clipboard operation
chatbox copied to clipboard

[BUG] Error on Mac Intel creating the KB due to libsql wrong architecture

Open jagaliano opened this issue 7 months ago • 1 comments

Bug Description Error: No handler registered for 'kb:create' on Mac Intel trying to initialize Local Knowledge base.

Steps to Reproduce Please provide the steps to reproduce the bug:

  1. Go to "Settings."
  2. Click on "Knowledge Base"
  3. Press "+Create First Knowledge Base"
  4. Fill the information
  5. Press "Create"
  6. Observe the "Bug"

Expected Results KB initialized.

Actual Results The Error.

*Additional Context

Chatbox v1.20.1 on ntel Mac couldn't create a Knowledge Base because it only ships the ARM64 (darwin-arm64) native binary for libsql.

The Fix by Claude

  1. Downloaded the correct x86_64 binary for @libsql/darwin-x64 v0.5.29 from npm
  2. Placed index.node + package.json into the unpacked asar folder at @libsql/darwin-x64/
  3. Patched libsql/index.js inside the .asar archive to fall back to loading the binary by absolute path when normal require('@libsql/darwin-x64') fails (Electron's asar module resolution couldn't find it otherwise)
  4. Repacked the .asar and replaced the original (backup saved as app.asar.backup2)

jagaliano avatar Apr 19 '26 17:04 jagaliano

Thanks for the detailed debugging! Currently, the Knowledge Base feature on macOS is only supported on Apple Silicon (ARM). We haven’t bundled the Intel (x64) binary yet, but we’ll definitely use your findings to help add support in a future update.

Andy115951 avatar Apr 20 '26 03:04 Andy115951