openclaw - 💡(How to fix) Fix WeChat plugin: hot-reload after new account login stops monitors for previously logged-in accounts

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…

After adding a second WeChat account via QR login, the gateway's hot-reload tears down the existing account's monitor and only starts the newly-added one; the old account stays dead until a full gateway restart.

Error Message

  • Severity: high for multi-account users — after every new QR login, the previously logged-in WeChat account silently stops receiving and sending messages, with no error surfaced to the operator.

Root Cause

After adding a second WeChat account via QR login, the gateway's hot-reload tears down the existing account's monitor and only starts the newly-added one; the old account stays dead until a full gateway restart.

Fix Action

Fix / Workaround

Notes:

  • The plugin side (startAccount / stopAccount in @tencent-weixin/openclaw-weixin 2.4.3, src/channel.ts) is structured to support concurrent accounts, so the regression appears to live entirely in the host gateway's hot-reload reconciliation path.
  • Workaround: run openclaw gateway restart after every new WeChat login.

Code Example

[reload] config hot reload applied (channels.openclaw-weixin.channelConfigUpdatedAt)
   [<account-B>] starting weixin provider
   [<account-B>] Monitor started
   [<account-A>] Monitor ended    <-- killed by abort, not restarted

---

16:45:02  [<account-A>] Monitor started
16:49:49  [reload] config hot reload applied (channels.openclaw-weixin.channelConfigUpdatedAt)
16:49:49  [<account-B>] starting weixin provider
16:49:49  [<account-B>] Monitor started
16:49:53  [<account-A>] Monitor ended

---

16:57:48  Monitor started: <account-B>
16:57:48  Monitor started: <account-A>

---

Plugin: @tencent-weixin/openclaw-weixin 2.4.3

Relevant gateway log lines (/tmp/openclaw/openclaw-<date>.log):


16:45:02  [<account-A>] Monitor started: baseUrl=https://ilinkai.weixin.qq.com
16:49:49  [reload] config hot reload applied (channels.openclaw-weixin.channelConfigUpdatedAt)
16:49:49  [<account-B>] starting weixin provider (https://ilinkai.weixin.qq.com)
16:49:49  [<account-B>] Monitor started: baseUrl=https://ilinkai.weixin.qq.com
16:49:53  [<account-A>] Monitor ended


After `openclaw gateway restart`:


16:57:48  [<account-B>] starting weixin provider
16:57:48  [<account-B>] Monitor started
16:57:48  [<account-A>] starting weixin provider
16:57:48  [<account-A>] Monitor started


Plugin source reference: `src/channel.ts` (gateway.startAccount / gateway.stopAccount). Each call carries a single `ctx.account`, so the plugin is structurally per-account; the reconcile-over-all-accounts contract belongs to the host gateway.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

After adding a second WeChat account via QR login, the gateway's hot-reload tears down the existing account's monitor and only starts the newly-added one; the old account stays dead until a full gateway restart.

Steps to reproduce

  1. Have one WeChat account already configured in ~/.openclaw/openclaw-weixin/accounts.json with its monitor running (gateway log shows Monitor started: <account-A>).
  2. Run openclaw channels login --channel openclaw-weixin and complete a QR scan to add a second account <account-B>.
  3. Tail /tmp/openclaw/openclaw-<date>.log. Observed sequence:
    [reload] config hot reload applied (channels.openclaw-weixin.channelConfigUpdatedAt)
    [<account-B>] starting weixin provider
    [<account-B>] Monitor started
    [<account-A>] Monitor ended    <-- killed by abort, not restarted
  4. Only <account-B> continues to receive inbound/outbound messages. <account-A> stays offline until openclaw gateway restart, after which both monitors start correctly.

Expected behavior

On channelConfigUpdatedAt hot-reload, the gateway should reconcile against the full account list in accounts.json and ensure startAccount is invoked (or the existing monitor preserved) for every configured account — not only the account whose login triggered the reload. After a cold gateway restart this behavior is observed, confirming it is the intended end-state.

Actual behavior

After QR login of <account-B>, the previously running monitor for <account-A> is aborted within ~4s and Monitor ended is logged; only <account-B> continues to process traffic. Excerpt:

16:45:02  [<account-A>] Monitor started
16:49:49  [reload] config hot reload applied (channels.openclaw-weixin.channelConfigUpdatedAt)
16:49:49  [<account-B>] starting weixin provider
16:49:49  [<account-B>] Monitor started
16:49:53  [<account-A>] Monitor ended

A subsequent openclaw gateway restart brings both monitors up:

16:57:48  Monitor started: <account-B>
16:57:48  Monitor started: <account-A>

Notes:

  • The plugin side (startAccount / stopAccount in @tencent-weixin/openclaw-weixin 2.4.3, src/channel.ts) is structured to support concurrent accounts, so the regression appears to live entirely in the host gateway's hot-reload reconciliation path.
  • Workaround: run openclaw gateway restart after every new WeChat login.

OpenClaw version

2026.5.12 (f066dd2)

Operating system

macOS 26.3 (arm64)

Install method

npm global (/opt/homebrew/lib/node_modules/openclaw, node 22.22.2)

Model

N/A — this is a gateway channel/hot-reload reconciliation bug; independent of the agent model.

Provider / routing chain

N/A — this is a gateway channel/hot-reload reconciliation bug; independent of provider routing.

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Plugin: @tencent-weixin/openclaw-weixin 2.4.3

Relevant gateway log lines (/tmp/openclaw/openclaw-<date>.log):


16:45:02  [<account-A>] Monitor started: baseUrl=https://ilinkai.weixin.qq.com
16:49:49  [reload] config hot reload applied (channels.openclaw-weixin.channelConfigUpdatedAt)
16:49:49  [<account-B>] starting weixin provider (https://ilinkai.weixin.qq.com)
16:49:49  [<account-B>] Monitor started: baseUrl=https://ilinkai.weixin.qq.com
16:49:53  [<account-A>] Monitor ended


After `openclaw gateway restart`:


16:57:48  [<account-B>] starting weixin provider
16:57:48  [<account-B>] Monitor started
16:57:48  [<account-A>] starting weixin provider
16:57:48  [<account-A>] Monitor started


Plugin source reference: `src/channel.ts` (gateway.startAccount / gateway.stopAccount). Each call carries a single `ctx.account`, so the plugin is structurally per-account; the reconcile-over-all-accounts contract belongs to the host gateway.

Impact and severity

  • Affected: any OpenClaw deployment that registers more than one WeChat account via the openclaw-weixin channel.
  • Severity: high for multi-account users — after every new QR login, the previously logged-in WeChat account silently stops receiving and sending messages, with no error surfaced to the operator.
  • Frequency: reproduced 1/1 in this report. Based on the hot-reload code path being deterministic (single startAccount call per channelConfigUpdatedAt event), it is expected to repeat every time a new account is added while another is running.
  • Consequence: inbound messages on the older account(s) are missed until a manual openclaw gateway restart; users do not realize their bot has gone offline until they notice missing replies.

Additional information

No response

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…

FAQ

Expected behavior

On channelConfigUpdatedAt hot-reload, the gateway should reconcile against the full account list in accounts.json and ensure startAccount is invoked (or the existing monitor preserved) for every configured account — not only the account whose login triggered the reload. After a cold gateway restart this behavior is observed, confirming it is the intended end-state.

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 WeChat plugin: hot-reload after new account login stops monitors for previously logged-in accounts