openclaw - 💡(How to fix) Fix [@tencent-weixin/openclaw-weixin] waitForWeixinRuntime() timeout in channel worker (v2.4.1, OpenClaw 2026.5.6) [1 comments, 2 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#78672Fetched 2026-05-07 03:34:03
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
2
Timeline (top)
closed ×1commented ×1mentioned ×1subscribed ×1

Error Message

waitForWeixinRuntime() failed: Error: Weixin runtime initialization timeout after 10000ms

notifyStart failed during startup (ignored): TypeError: fetch failed cause: ConnectTimeoutError: Connection timed out connecting to ilinkai.weixin.qq.com

Root Cause

Confirmed through code inspection:

monitor.js calls waitForWeixinRuntime() which polls for a module-level global variable pluginRuntime. This variable is set only once — when the plugin calls setWeixinRuntime(api.runtime) during register() in the gateway main process.

However, startAccount() (which calls monitorWeixinProvider) runs in a separate channel worker process with a different module context. The worker's module-level pluginRuntime is always null, so waitForWeixinRuntime() always times out after 10 seconds.

The opts.runtime passed to startAccount is of type RuntimeEnv (from ChannelPluginContext), which does not contain channelRuntime. Attempting to access opts.runtime?.channelRuntime returns undefined.

Fix Action

Fix / Workaround

Tried patching monitor.js to use opts.runtime?.channelRuntime as a fallback:

Code Example

waitForWeixinRuntime() failed: Error: Weixin runtime initialization timeout after 10000ms

notifyStart failed during startup (ignored): TypeError: fetch failed
  cause:
    ConnectTimeoutError: Connection timed out connecting to ilinkai.weixin.qq.com
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw version: 2026.5.6
  • Plugin version: @tencent-weixin/openclaw-weixin 2.4.1 (latest)
  • Installation method: openclaw plugins install "@tencent-weixin/openclaw-weixin"
  • OS: Windows/WSL (Linux environment)
  • Node.js: via openclaw npm package

Problem Summary

The WeChat channel enters a crash loop: every ~10 seconds the channel worker restarts with a "Weixin runtime initialization timeout" error. The channel shows ON·OK in openclaw status but is never actually functional.

Exact Error

waitForWeixinRuntime() failed: Error: Weixin runtime initialization timeout after 10000ms

notifyStart failed during startup (ignored): TypeError: fetch failed
  cause:
    ConnectTimeoutError: Connection timed out connecting to ilinkai.weixin.qq.com

Reproduction Steps

  1. openclaw channels enable openclaw-weixin
  2. openclaw channels login --channel openclaw-weixin (QR scan, successful)
  3. systemctl --user restart openclaw-gateway
  4. After ~10 seconds: channel worker crashes and restarts in a loop

Root Cause Analysis

Confirmed through code inspection:

monitor.js calls waitForWeixinRuntime() which polls for a module-level global variable pluginRuntime. This variable is set only once — when the plugin calls setWeixinRuntime(api.runtime) during register() in the gateway main process.

However, startAccount() (which calls monitorWeixinProvider) runs in a separate channel worker process with a different module context. The worker's module-level pluginRuntime is always null, so waitForWeixinRuntime() always times out after 10 seconds.

The opts.runtime passed to startAccount is of type RuntimeEnv (from ChannelPluginContext), which does not contain channelRuntime. Attempting to access opts.runtime?.channelRuntime returns undefined.

Attempted Fix

Tried patching monitor.js to use opts.runtime?.channelRuntime as a fallback:

This did not work because opts.runtime (type RuntimeEnv) does not have a channelRuntime property.

Expected Behavior

The WeChat channel should initialize successfully and receive incoming messages without timing out.

Additional Context

  • The WeChat account is already logged in (credentials saved in ~/.openclaw/openclaw-weixin/accounts/)
  • Network access to ilinkai.weixin.qq.com times out from this environment — this may be a separate issue, but the runtime timeout occurs even when the network issue is bypassed
  • Other channels (Feishu, etc.) work fine with the same OpenClaw installation
  • Plugin version 2.3.1 exhibits the same issue
  • No newer version available (npm view @tencent-weixin/openclaw-weixin dist-tags shows latest: 2.4.1)

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

openclaw - 💡(How to fix) Fix [@tencent-weixin/openclaw-weixin] waitForWeixinRuntime() timeout in channel worker (v2.4.1, OpenClaw 2026.5.6) [1 comments, 2 participants]