Skip to content

Matrix extension deps wiped on every npm update — @vector-im/matrix-bot-sdk not in top-level package.json #41431

@JustHereToHelp

Description

@JustHereToHelp

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

  1. Was running v2026.3.2, Matrix working fine
  2. Updated to v2026.3.8
  3. Gateway restarted, Matrix channel immediately started failing
  4. Auto-restart burned through all 10 attempts before I noticed
  5. Had to manually cd into the openclaw package dir and npm install @vector-im/matrix-bot-sdk
  6. 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-sdk listed as top-level dependencies (or optionalDependencies) so npm doesn't remove them
  • openclaw doctor --repair detecting 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-sdk in [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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions