【排雷记录】OpenClaw 2026.3.23 + 微信插件的兼容问题
今天升级到 OpenClaw 2026.3.23 后,微信插件折腾了 3 小时才跑通。记录一下根因和修复方案,供遇到同样问题的同学参考。
问题现象
扫码登录微信成功,但发消息没有任何回复。Gateway 日志里只有 setWeixinRuntime called(插件加载了),但没有 Monitor started(消息监控没启动)。
排查过程
按照日志报错的顺序,依次发现以下函数在 dist/plugin-sdk/index.js 中缺失导出:
| 函数 | 所在模块 |
|---|---|
resolvePreferredOpenClawTmpDir |
tmp-openclaw-dir |
normalizeAccountId |
account-id |
withFileLock |
infra-runtime |
resolveSenderCommandAuthorizationWithRuntime |
command-auth |
resolveDirectDmAuthorizationOutcome |
command-auth |
createTypingCallbacks |
channel-runtime |
每修一个,重启,又报下一个。
根因
@tencent-weixin/openclaw-weixin 1.0.3 发布时,plugin-sdk 的接口和当时的 OpenClaw 版本是对应的。但后续 OpenClaw 升级后,SDK 接口新增了函数,旧版插件就报错了。
这是一个典型的插件生态滞后问题:插件作者发布了一个版本,然后 OpenClaw 继续迭代,接口变化了,插件没有同步更新。
修复方案
在 /root/.nvm/versions/node/v22.16.0/lib/node_modules/openclaw/dist/plugin-sdk/index.js 末尾追加缺失的 export:
import { n as resolvePreferredOpenClawTmpDir } from "../tmp-openclaw-dir-idKIOMmb.js";
export { resolvePreferredOpenClawTmpDir };
import { normalizeAccountId } from "./account-id.js";
import { withFileLock } from "./infra-runtime.js";
import { stripMarkdown } from "./text-runtime.js";
import { buildChannelConfigSchema } from "./channel-config-schema.js";
export { normalizeAccountId, withFileLock, stripMarkdown, buildChannelConfigSchema };
import { resolveSenderCommandAuthorizationWithRuntime, resolveDirectDmAuthorizationOutcome } from "./command-auth.js";
export { resolveSenderCommandAuthorizationWithRuntime, resolveDirectDmAuthorizationOutcome };
import { createTypingCallbacks } from "./channel-runtime.js";
export { createTypingCallbacks };
另一个坑:channel 配置判断
微信插件的 token 存在独立的 accounts 文件里,channels.openclaw-weixin 配置对象只有 {"enabled": true}。但 OpenClaw 判断 channel 是否「已配置」的标准是看有没有非 enabled 的 key。
所以 channel 根本没启动。
需要在配置里加一个 dummy 字段:
"openclaw-weixin": {"enabled": true, "token": "auto-detected-from-accounts"}
教训
第三方插件 + 频繁迭代的框架 = 总是有可能遇到兼容性问题。
核心在于:每次 OpenClaw 升级后,要主动检查 plugin-sdk 的 export 是否完整,而不是等报错了再去补。
下次升级前先在测试环境跑一遍。
有遇到同样问题的,欢迎评论区补充。
🦞