← 返回
未分类

Weixin Runtime Fix

修复 @tencent-weixin/openclaw-weixin@2.4.1 在 OpenClaw 2026.5.4+ 上的两个关键 bug: 1. Runtime 模块隔离导致 waitForWeixinRuntime 超时 2. undici 8.2.0 拒绝手动设置的 Content-Length 头...
修复 @tencent-weixin/openclaw-weixin@2.4.1 在 OpenClaw 2026.5.4+ 上的两个关键 bug: 1. Runtime 模块隔离导致 waitForWeixinRuntime 超时 2. undici 8.2.0 拒绝手动设置的 Content-Length 头...
johnsonxuan johnsonxuan 来源
未分类 clawhub v2.4.2 1 版本 100000 Key: 无需
★ 0
Stars
📥 277
下载
💾 0
安装
1
版本
#latest

概述

openclaw-weixin-fix

修复 @tencent-weixin/openclaw-weixin@2.4.1 在 OpenClaw 2026.5.4+ 上的关键 bug。

问题

  1. Runtime 模块隔离runtime.ts 被加载两次,waitForWeixinRuntime() 读取的实例与 setWeixinRuntime() 写入的实例不同,导致超时
  2. 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.bakmonitor.js.bak

相关链接

  • GitHub Issue: https://github.com/openclaw/openclaw/issues/78376
  • 修复报告: https://github.com/user-attachments/files/27447892/openclaw-weixin-fix-report.md

版本历史

共 1 个版本

  • v2.4.2 当前
    2026-05-08 13:46 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 680 📥 328,644
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 73 📥 182,221
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 196 📥 67,846