Weixin Runtime Fix
/install weixin-runtime-fix
openclaw-weixin-fix
修复 @tencent-weixin/[email protected] 在 OpenClaw 2026.5.4+ 上的关键 bug。
问题
- Runtime 模块隔离:
runtime.ts被加载两次,waitForWeixinRuntime()读取的实例与setWeixinRuntime()写入的实例不同,导致超时 - Content-Length 拒绝:undici 8.2.0 不允许手动设置
Content-Length头
修复内容
改动1:channel.js — 传递 channelRuntime
return monitorWeixinProvider({
...
setStatus: ctx.setStatus,
+ channelRuntime: ctx.channelRuntime,
});
改动2:monitor.js — 优先使用传入的 channelRuntime
let channelRuntime;
- try {
- const pluginRuntime = await waitForWeixinRuntime();
- channelRuntime = pluginRuntime.channel;
- }
+ if (opts.channelRuntime) {
+ channelRuntime = opts.channelRuntime;
+ } else {
+ try {
+ const pluginRuntime = await waitForWeixinRuntime();
+ channelRuntime = pluginRuntime.channel;
+ }
+ catch (err) { ... }
+ }
改动3:api.js — 删除 Content-Length 头
删除 buildHeaders() 中手动设置 Content-Length 的代码。
验证结果
- ✅ 微信消息接收正常
- ✅ 微信回复发送成功
- ✅ 文件上传正常
- ✅
openclaw health --json显示lastError: null
注意事项
- 每次
openclaw plugins install重装插件后,需要重新运行此修复 - 备份文件:
channel.js.bak和monitor.js.bak
相关链接
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install weixin-runtime-fix - After installation, invoke the skill by name or use
/weixin-runtime-fix - Provide required inputs per the skill's parameter spec and get structured output
What is Weixin Runtime Fix?
修复 @tencent-weixin/[email protected] 在 OpenClaw 2026.5.4+ 上的两个关键 bug: 1. Runtime 模块隔离导致 waitForWeixinRuntime 超时 2. undici 8.2.0 拒绝手动设置的 Content-Length 头... It is an AI Agent Skill for Claude Code / OpenClaw, with 30 downloads so far.
How do I install Weixin Runtime Fix?
Run "/install weixin-runtime-fix" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Weixin Runtime Fix free?
Yes, Weixin Runtime Fix is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Weixin Runtime Fix support?
Weixin Runtime Fix is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Weixin Runtime Fix?
It is built and maintained by johnsonxuan (@johnsonxuan); the current version is v2.4.2.