mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-22 05:14:02 +00:00
`ensureMatrixSdkInstalled` previously derived an install `cwd` via fixed two-segment traversal from `import.meta.url` and spawned `npm install` (or `pnpm install`) when Matrix packages were missing. Under the externalized plugin layout the derived path is a scope directory like `<config>/npm/node_modules/@openclaw`, so npm walks up to the managed project root and prunes undeclared siblings. Under the legacy bundled layout it would target `<global-prefix>/lib/node_modules` and could delete unrelated global CLIs. Matrix is now a pure availability check: if any required package fails to resolve, it throws an actionable error pointing the operator at the supported repair commands (`openclaw plugins update matrix`, `openclaw doctor --fix`). This matches extensions/AGENTS.md: "Runtime never installs deps; install/update/doctor are repair points." The exported signature stays backwards-compatible (all params optional; `confirm` and `runtime` are accepted but ignored). `resolveMissingMatrixPackages` gains an optional `resolveFn` seam for testability, mirroring the existing `ensureMatrixCryptoRuntime` injection pattern. Fixes #80758.