openclaw - 💡(How to fix) Fix openclaw-weixin: runtime module scope isolation on 2026.5.4 [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#78376Fetched 2026-05-07 03:37:38
View on GitHub
Comments
3
Participants
4
Timeline
7
Reactions
2
Timeline (top)
commented ×3cross-referenced ×3closed ×1

After upgrading to OpenClaw 2026.5.4, the openclaw-weixin plugin (v2.4.1) fails with Weixin runtime initialization timeout. Debug logging shows setWeixinRuntime() succeeds but waitForWeixinRuntime() polls a different module instance where pluginRuntime stays NULL.

Error Message

InvalidArgumentError: invalid content-length header at processHeader (openclaw/node_modules/undici/lib/core/request.js:503) Cause code: UND_ERR_INVALID_ARG

Root Cause

The pluginRuntime variable in runtime.js exists in two separate module scopes:

  1. Scope Aregister()setWeixinRuntime(api.runtime) sets pluginRuntime
  2. Scope Bmonitor.jswaitForWeixinRuntime() polls pluginRuntime which is NULL

This is caused by OpenClaw 2026.5.4's plugin loader creating separate module instances for the same file path.

Code Example

InvalidArgumentError: invalid content-length header
  at processHeader (openclaw/node_modules/undici/lib/core/request.js:503)
  Cause code: UND_ERR_INVALID_ARG

---

openclaw --version              # 2026.5.4
openclaw plugins install @tencent-weixin/openclaw-weixin  # v2.4.1
openclaw channels login --channel openclaw-weixin
# Scan QR → timeout

---

[runtime] setWeixinRuntime called, runtime set successfully
[runtime] waitForWeixinRuntime: pluginRuntime=NULL, start=1778056361184
[runtime] waitForWeixinRuntime: still waiting... 101ms, pluginRuntime=NULL
[runtime] waitForWeixinRuntime: still waiting... 2012ms, pluginRuntime=NULL
[runtime] waitForWeixinRuntime: TIMEOUT after 10058ms, pluginRuntime still NULL
RAW_BUFFERClick to expand / collapse

Description

After upgrading to OpenClaw 2026.5.4, the openclaw-weixin plugin (v2.4.1) fails with Weixin runtime initialization timeout. Debug logging shows setWeixinRuntime() succeeds but waitForWeixinRuntime() polls a different module instance where pluginRuntime stays NULL.

Root Cause

The pluginRuntime variable in runtime.js exists in two separate module scopes:

  1. Scope Aregister()setWeixinRuntime(api.runtime) sets pluginRuntime
  2. Scope Bmonitor.jswaitForWeixinRuntime() polls pluginRuntime which is NULL

This is caused by OpenClaw 2026.5.4's plugin loader creating separate module instances for the same file path.

Additional: Content-Length header rejection

OpenClaw 2026.5.4 bundles undici 8.2.0 which rejects the plugin's Content-Length header:

InvalidArgumentError: invalid content-length header
  at processHeader (openclaw/node_modules/undici/lib/core/request.js:503)
  Cause code: UND_ERR_INVALID_ARG

Reproduction

openclaw --version              # 2026.5.4
openclaw plugins install @tencent-weixin/openclaw-weixin  # v2.4.1
openclaw channels login --channel openclaw-weixin
# Scan QR → timeout

Debug Logs

[runtime] setWeixinRuntime called, runtime set successfully
[runtime] waitForWeixinRuntime: pluginRuntime=NULL, start=1778056361184
[runtime] waitForWeixinRuntime: still waiting... 101ms, pluginRuntime=NULL
[runtime] waitForWeixinRuntime: still waiting... 2012ms, pluginRuntime=NULL
[runtime] waitForWeixinRuntime: TIMEOUT after 10058ms, pluginRuntime still NULL

Environment

  • OpenClaw: 2026.5.4 (325df3e)
  • Node.js: 22.22.1 (Gateway) / 24.15.0 (CLI)
  • OS: WSL2 (Linux 6.6.87.2)
  • Plugin: @tencent-weixin/[email protected]
  • Bundled undici: 8.2.0

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING