-
-
Notifications
You must be signed in to change notification settings - Fork 69.6k
Matrix extension deps wiped on every npm update — @vector-im/matrix-bot-sdk not in top-level package.json #41431
Description
What happens
After updating OpenClaw via npm install -g openclaw (or the install script), the Matrix channel immediately crash-loops with:
Cannot find module '@vector-im/matrix-bot-sdk'
Require stack:
- /home/deploy/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/extensions/matrix/src/matrix/sdk-runtime.ts
The Matrix SDK gets nuked because it's installed as an extension dependency rather than a top-level dependency in OpenClaw's package.json. Every global npm install wipes node_modules and only reinstalls what's declared at the top level.
How I hit this
- Was running v2026.3.2, Matrix working fine
- Updated to v2026.3.8
- Gateway restarted, Matrix channel immediately started failing
- Auto-restart burned through all 10 attempts before I noticed
- Had to manually
cdinto the openclaw package dir andnpm install @vector-im/matrix-bot-sdk - SIGUSR1 restart didn't help (Node caches the failed require), needed a full
openclaw gateway restart
The real kicker
openclaw doctor --repair doesn't catch or fix this either. Ran it after the update, Matrix was still broken.
This is the same bug as #15622
#15622 reports the identical problem for Teams — @microsoft/agents-hosting gets wiped on every update because it's not in the top-level package.json. Matrix has the same root cause.
The Docker/Podman side already has a workaround via OPENCLAW_EXTENSIONS (#32223) to pre-bake extension deps into container images. But for regular npm/global installs on Linux VPS (which is probably the most common Matrix deployment), there's no solution. You just break every time you update.
What I'd expect
One of:
- Extension deps like
@vector-im/matrix-bot-sdklisted as top-level dependencies (or optionalDependencies) so npm doesn't remove them openclaw doctor --repairdetecting missing extension deps and reinstalling them- The update/install script running extension dep installation as a post-install step
- At minimum, the gateway logging a clear actionable error like "Matrix SDK missing, run
npm install @vector-im/matrix-bot-sdkin [path]" instead of a raw Node require trace
Environment
- OpenClaw: 2026.3.8 (3caab92)
- OS: Debian 12 (x64)
- Node: v22.22.0 (via nvm)
- Channel: Matrix (via
extensions/matrix) - Install method:
npm install -g openclaw