-
-
Notifications
You must be signed in to change notification settings - Fork 68.9k
[Bug]: Fix: Matrix plugin dependency breaks after updates due to workspace: reference* #11245
Description
Problem Statement
After OpenClaw updates, the Matrix plugin fails to start with a missing matrix-bot-sdk dependency error. This occurs even though the dependency is properly listed in extensions/matrix/package.json.
Symptoms:
Matrix messages cannot be sent or received
Gateway logs show Cannot find module 'matrix-bot-sdk' errors
Manual npm install in the extension directory temporarily resolves the issue
Issue recurs after subsequent updates
Root Cause
The extensions/matrix/package.json file contains a devDependency referencing the parent package:
"devDependencies": {
"clawdbot": "workspace:"
}
This workspace: protocol is a pnpm/npm workspaces feature that creates a symlink to the parent package during development. However:
During updates, the workspace relationship may be broken or corrupted
Native binaries (Rust/C++ for Matrix crypto) fail to resolve correctly through the workspace symlink
The package manager doesn't recognize that matrix-bot-sdk needs reinstallation when the workspace link is stale
Proposed Solution
Option 1: Remove workspace dependency (Immediate Fix)
Remove the "clawdbot": "workspace:*" devDependency entirely from extensions/matrix/package.json, as it's not required for runtime functionality:
"devDependencies": {
- "clawdbot": "workspace:*"
}
Option 2: Pin to specific version (Alternative)
If the parent package reference is required for types/development:
"devDependencies": {
- "clawdbot": "workspace:*",
- "openclaw": "^2026.1.30",
}
Recommended: Option 1
The Matrix extension should be self-contained and not require a circular reference to its parent. This eliminates the workspace resolution issue entirely.
Testing Done
✅ Manually edited extensions/matrix/package.json to remove workspace dependency
✅ Ran npm install in extension directory
✅ Restarted OpenClaw gateway
✅ Verified Matrix messages send/receive correctly
✅ Created automated repair script (fix-matrix-sdk.sh) that runs on system boot
✅ Tested across multiple OpenClaw updates—issue no longer recurs
Implementation Notes
The fix can be applied in the OpenClaw core repository by updating the template extensions/matrix/package.json
Users experiencing this issue can run the repair script (attached) or manually edit the file
Consider documenting this as a known issue in upgrade notes until the fix is merged
Additional Context
This issue affects production deployments where Matrix is the primary communication channel. The repair script provides an interim workaround, but fixing the root cause in the repository prevents new installations from encountering it.
Files affected:
extensions/matrix/package.json
Related:
Native binary resolution for @matrix-org/olm and matrix-bot-sdk
pnpm workspace protocol behavior during package updates