Skip to content

[Bug]: WeChat plugin fails to start — api.runtime undefined in 2026.5.4 causes runtime initialization timeout #77779

@php737

Description

@php737

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading OpenClaw from 2026.3.x to 2026.5.4, the @tencent-weixin/openclaw-weixin plugin (v2.4.1) fails to start with Weixin runtime initialization timeout and enters an auto-restart crash loop (10 attempts). The root cause is that api.runtime is now undefined in the plugin register() callback, so setWeixinRuntime() is never called.

Steps to reproduce

  1. Install OpenClaw 2026.5.4 (pnpm on Linux)
  2. Install @tencent-weixin/openclaw-weixin v2.4.1 via openclaw plugins install
  3. Configure and enable the WeChat channel
  4. Run openclaw gateway restart
  5. Observe the gateway logs showing repeated Weixin runtime initialization timeout errors

Expected behavior

The WeChat plugin should start successfully, connect to https://ilinkai.weixin.qq.com, and begin long-polling for messages. This worked correctly on OpenClaw 2026.3.x with the same plugin version 2.4.1.

Actual behavior

The plugin enters a crash loop:

[starting weixin provider (https://ilinkai.weixin.qq.com)]
[waiting for Weixin runtime...]
[waitForWeixinRuntime() failed: Error: Weixin runtime initialization timeout]
[channel exited: Weixin runtime initialization timeout]
[auto-restart attempt N/10 in Xs]

Also observed during login attempt:

Failed to start login: TypeError: fetch failed
Channel login failed: Error: Failed to start login: TypeError: fetch failed

Network connectivity to ilinkai.weixin.qq.com is confirmed working (curl and Node.js fetch from CLI both succeed).

Root cause analysis

In the plugin entry point (index.js):

register(api) {
    assertHostCompatibility(api.runtime?.version);
    if (api.runtime) {                    // ← api.runtime is undefined in 2026.5.4
        setWeixinRuntime(api.runtime);    // ← never called
    }
    api.registerChannel({ plugin: weixinPlugin });
}

The monitor then calls waitForWeixinRuntime() which polls for the global pluginRuntime variable — but since setWeixinRuntime() was never called, it always times out after 10 seconds.

In 2026.3.x, api.runtime was populated during register(). In 2026.5.4, it appears to be undefined — likely a breaking change in the plugin SDK.

OpenClaw version

2026.5.4 (325df3e)

Operating system

Linux 6.17.0-22-generic (x64), Node.js v24.15.0

Install method

pnpm (global)

Model

N/A (channel-level issue, not model-specific)

Provider / routing chain

N/A (WeChat channel plugin, not model routing)

Logs, screenshots, and evidence

Gateway log excerpt (repeated ~6 times before giving up):

2026-05-05T17:06:28.465+08:00 [openclaw-weixin] [04ec3e0661b8-im-bot] starting weixin provider (https://ilinkai.weixin.qq.com)
2026-05-05T17:06:28.816+08:00 [openclaw-weixin] [04ec3e0661b8-im-bot] notifyStart failed during startup (ignored): TypeError: fetch failed
2026-05-05T17:06:38.479+08:00 [openclaw-weixin] [04ec3e0661b8-im-bot] channel exited: Weixin runtime initialization timeout
2026-05-05T17:06:38.483+08:00 [openclaw-weixin] [04ec3e0661b8-im-bot] auto-restart attempt 1/10 in 5s

openclaw status --deep output shows channel state as ON | OK despite the crash loop, which may also be worth investigating.

Impact and severity

Affected: All users of @tencent-weixin/openclaw-weixin plugin on OpenClaw 2026.5.4
Severity: High — WeChat channel is completely non-functional, cannot send or receive messages
Frequency: 100% reproducible (every startup attempt fails)
Consequence: WeChat bot is offline; users relying on WeChat channel for communication are affected

Additional information

  • Last known good version: OpenClaw 2026.3.x (exact version varied, plugin 2.4.1 worked)
  • First known bad version: OpenClaw 2026.5.4
  • Plugin version: @tencent-weixin/openclaw-weixin v2.4.1 (latest on npm)
  • The compatibility table in the plugin README lists >=2026.3.22 as compatible, but 2026.5.4 appears to have a breaking change in the plugin SDK that was not accounted for
  • This may also affect other channel plugins that rely on api.runtime in their register() callback

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions