Skip to content

[Bug]: openclaw plugins install does not install peer dependency — plugin fails to load after install #53517

@XIYBHK

Description

@XIYBHK

Bug type

Behavior bug (incorrect output/state without crash)

Summary

openclaw plugins install does not install declared peerDependencies into the plugin's node_modules, causing the plugin to fail at load time and crash the gateway.

Steps to reproduce

  1. Install OpenClaw 2026.3.23-2 globally on Windows
  2. Run openclaw plugins install @tencent-weixin/openclaw-weixin@latest (installs v2.0.1)
  3. Run openclaw gateway restart
  4. Gateway crashes — plugin cannot resolve openclaw/plugin-sdk/* imports

Expected behavior

openclaw plugins install should ensure declared peerDependencies (e.g., "openclaw": ">=2026.3.22") are resolvable from the plugin's install directory, either by installing them into the plugin's node_modules, symlinking the host package, or using Node's module resolution to find the globally installed openclaw.

Actual behavior

Plugin installs successfully but openclaw is not present in ~/.openclaw/extensions/openclaw-weixin/node_modules/. At load time:

[plugins] openclaw-weixin failed to load from C:\Users\Administrator\.openclaw\extensions\openclaw-weixin\index.ts: Error: Cannot find module 'openclaw/plugin-sdk/channel-config-schema'
Require stack:
- C:\Users\Administrator\.openclaw\extensions\openclaw-weixin\index.ts
[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: openclaw-weixin

The gateway then crash-loops with exit code 1, repeatedly failing to load the plugin every ~1 second.

By comparison, @larksuite/openclaw-lark@2026.3.25 installed via npx @larksuite/openclaw-lark-tools update does include openclaw in its own node_modules and loads fine.

OpenClaw version

2026.3.23-2 (7ffe7e4)

Operating system

Windows 11 Pro (10.0.22631)

Install method

npm global

Model

openai/gpt-5.4

Provider / routing chain

openclaw -> openai (via proxy)

Logs, screenshots, and evidence

# Plugin declares peer dependency
$ cat ~/.openclaw/extensions/openclaw-weixin/package.json | grep -A1 peerDep
"peerDependencies": { "openclaw": ">=2026.3.22" }

# But openclaw is missing from plugin's node_modules
$ ls ~/.openclaw/extensions/openclaw-weixin/node_modules/openclaw
ls: cannot access: No such file or directory

# Compare with openclaw-lark which works fine
$ ls ~/.openclaw/extensions/openclaw-lark/node_modules/openclaw
CHANGELOG.md  LICENSE  README.md  assets  dist

# Workaround: manually install the peer dep
$ cd ~/.openclaw/extensions/openclaw-weixin && npm install openclaw@2026.3.23
added 551 packages
# After this, plugin loads and gateway starts successfully

Impact and severity

Affected: Any user installing third-party plugins via openclaw plugins install that declare openclaw as a peer dependency
Severity: High (gateway crash-loop, all channels down)
Frequency: 100% repro on fresh install of openclaw-weixin 2.0.1
Consequence: Gateway becomes completely unavailable until manual npm install workaround is applied. No useful error message guides the user to the fix.

Additional information

  • The openclaw package is "type": "module" with exports map including ./plugin-sdk/channel-config-schema — the file exists at dist/plugin-sdk/channel-config-schema.js, resolution fails purely because the package is absent from the plugin's node_modules
  • openclaw-weixin 2.0.1 uses ESM import syntax (import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema")
  • Workaround: cd ~/.openclaw/extensions/openclaw-weixin && npm install openclaw@2026.3.23
  • Related: this was the root cause of a gateway that appeared to "auto-shutdown after version update" — upgrading core from 3.13 to 3.23 without upgrading plugins left incompatible plugins that crashed the gateway silently (no error in file log, exit code 1)

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