fix: add better-sqlite3 and koffi to onlyBuiltDependencies allowlist - #7
Draft
Secret297-CODER-SOURCE with Copilot wants to merge 3 commits into
Draft
fix: add better-sqlite3 and koffi to onlyBuiltDependencies allowlist#7Secret297-CODER-SOURCE with Copilot wants to merge 3 commits into
Secret297-CODER-SOURCE with Copilot wants to merge 3 commits into
Conversation
…rkspace.yaml Co-authored-by: Secret297-CODER-SOURCE <73541046+Secret297-CODER-SOURCE@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add better-sqlite3 to pnpm allowlist for native builds
fix: add better-sqlite3 and koffi to onlyBuiltDependencies allowlist
Mar 10, 2026
Adds the native better-sqlite3 package to package.json dependencies. Run your package manager (npm/yarn) to install the new dependency after pulling this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
better-sqlite3was absent frompnpm-workspace.yaml'sonlyBuiltDependenciesallowlist, causing pnpm to silently skip its native binding compilation. Result:telegram-managerfailed to load at gateway start withCannot find module 'better-sqlite3'/ missingbetter_sqlite3.node.Summary
better-sqlite3not inonlyBuiltDependencies→ pnpm skips itsinstallscript → native.nodebinding never built →telegram-managerplugin crashes on loadtelegram-manageris completely non-functional without the binding; error is silent and confusing (no build-time warning, only a runtime crash)better-sqlite3andkoffitoonlyBuiltDependenciesinpnpm-workspace.yaml.koffialready ran its install script successfully per logs but was undeclared — added for correctness.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
telegram-managerplugin loads successfully afterpnpm install. Previously crashed gateway startup with a native binding error.Security Impact (required)
NoNoNoNo—onlyBuiltDependenciesis an allowlist; adding entries permits already-present packages to run their own declared install scripts, not arbitrary codeNoRepro + Verification
Environment
telegram-managerextensionSteps
pnpm installopenclaw gateway runExpected
telegram-managerplugin loads; no binding errors in gateway logActual (before fix)
[plugins] telegram-manager failed to load: Error: Cannot find module 'better-sqlite3'Evidence
installscript executionHuman Verification (required)
pnpm-workspace.yamldiff is minimal and correct;kofficonfirmed already running install script in logs prior to this fixpnpm install+ gateway boot cycle in this environment (no native build toolchain available in sandbox)Compatibility / Migration
YesNoYes— users must runpnpm installonce after pulling to trigger thebetter-sqlite3native buildFailure Recovery (if this breaks)
pnpm-workspace.yaml; runpnpm installpnpm-workspace.yamlbetter-sqlite3build fails on a platform, gateway will log a native binding error ontelegram-managerload (same as before — no regression, just no improvement on that platform)Risks and Mitigations
better-sqlite3native build fails on a platform (e.g. missing Python/node-gyp)telegram-managerplugin load; gateway continues running. No worse than the current state.Original prompt
Problem
The
telegram-managerextension fails to load with:This happens because
pnpm-workspace.yamlhas anonlyBuiltDependenciesallowlist that controls which packages are allowed to run install/build scripts.better-sqlite3is missing from this list, so pnpm never compiles its native.nodebinding for the current platform (darwin/arm64, Node v22).Root Cause
In
pnpm-workspace.yaml:better-sqlite3is not in this list. pnpm'sonlyBuiltDependenciesis a security allowlist — if a package is not on it, itsinstall/postinstallbuild scripts are silently skipped. Without those scripts, the native.nodebinding (better_sqlite3.node) is never compiled, so Node.js cannotrequire('better-sqlite3').Fix
Add
better-sqlite3to theonlyBuiltDependencieslist inpnpm-workspace.yaml:Note:
koffiis also added since it already runs its install script successfully (visible in the logs) — it should be in the list too for consistency and correctness.After this change, the user must run:
to trigger the native build for
better-sqlite3.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: zsh: command not found: #
Now using node v22.22.1 (npm v10.9.4)
zsh: command not found: #
worker@MacBook-Air-Worker openclaw % # Ensure Node 22
nvm use 22
Remove old modules and lockfile
rm -rf node_modules pnpm-lock.yaml
Reinstall everything
pnpm install -w
Rebuild native modules
pnpm rebuild
Build the Control UI
pnpm ui:build
zsh: command not found: #
Now using node v22.22.1 (npm v10.9.4)
zsh: command not found: #
zsh: command not found: #
WARN 15 deprecated subdependencies found: are-we-there-yet@2.0.0, are-we-there-yet@3.0.1, form-data@2.5.4, gauge@3.0.2, gauge@4.0.4, glob@10.5.0, glob@7.2.3, has-own@1.0.1, inflight@1.0.6, node-domexception@1.0.0, npmlog@5.0.1, npmlog@6.0.2, prebuild-install@7.1.3, rimraf@3.0.2, yaeti@0.0.6
Progress: resolved 1264, reused 1, downloaded 0, added 0, done
WARN Issues with peer dependencies found
.
└─┬ oxlint 1.52.0
└── ✕ unmet peer oxlint-tsgolint@>=0.15.0: found 0.14.2
extensions/matrix
└─┬ @vector-im/matrix-bot-sdk 0.8.0-element.3
└─┬ @cypress/request-promise 5.0.0
└─┬ request-promise-core 1.1.3
└── ✕ unmet peer request@^2.34: found 3.0.10
extensions/telegram-manager
└─┬ openclaw 2026.3.8
├── ✕ unmet peer node-llama-cpp@3.16.2: found 3.15.1
└─┬ @buape/carbon 0.0.0-beta-20260216184201
└─┬ @discordjs/voice 0.19.0
└─┬ prism-media 1.3.5
└── ✕ unmet peer opusscript@^0.0.8: found 0.1.1 in openclaw
Packages: +825
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
. prepare$ command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0
└─ Done in 58ms
Done in 16.1s using pnpm v10.23.0
zsh: command not found: #
node_modules/.pnpm/koffi@2.15.1/node_modules/koffi: Running install script, done in 338ms
node_modules/.pnpm/esbuild@0.27.3/node_modules/esbuild: Running postinstall script, done in 337ms
node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs: Running postinstall script, done in 32ms
node_modules/.pnpm/protobufjs@6.8.8/node_modules/protobufjs: Running postinstall script, done in 30ms
node_modules/.pnpm/sharp@0.34.5/node_modules/sharp: Running install script, done in 1.1s
node_modules/.pnpm/@WhiskeySockets+baileys@7.0.0-rc.9_bufferutil@4.1.0_sharp@0.34.5_utf-8-validate@5.0.10/node_modules/@whiskeysockets/baileys: Running preinstall script, done in 33ms
node_modules/.pnpm/node-llama-cpp@3.15.1_typescript@5.9.3/node_modules/node-llama-cpp: Running postinstall script, done in 1.8s
. prepare$ command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0
└─ Done in 55ms
zsh: command not found: #
Scope: all 36 workspace projects
✔ The modules directories will be removed and reinstalled from scratch. Proceed? (Y/n) · true
Recreating /Users/worker/Documents/GitHub/openclaw/ui/node_modules
.. ...
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.