openclaw - 💡(How to fix) Fix [Bug] openclaw-weixin: outbound push reports success but never delivers to personal WeChat accounts [2 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#68805Fetched 2026-04-19 15:07:13
View on GitHub
Comments
2
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×2

Error Message

  1. Or: if personal WeChat accounts cannot support outbound push via this protocol, document this limitation clearly and show a warning/error instead of "sent OK"

Root Cause

Root Cause Investigation

Fix Action

Workaround

Users can fall back to asking the AI directly in conversation (inbound works fine). Cron job notifications need to be delivered via alternative channels (e.g., email) until this bug is fixed.

Code Example

gateway/channels/openclaw-weixin outbound: to=o9cq806I1a0W_IZksCrTaeiCf6gk@im.wechat contextToken=AARzJW...(len=136) textLen=194 mediaUrl=none
gateway/channels/openclaw-weixin outbound: text sent OK to=o9cq806I1a0W_IZksCrTaeiCf6gk@im.wechat

---

Login confirmed! ilink_bot_id=e97a6e609973@im.bot
   clearStaleAccountsForUserId: removing stale account=bdfa73875fac-im-bot
   clearContextTokensForAccount: cleared tokens for account=bdfa73875fac-im-bot

---

~/.qclaw/openclaw-weixin/accounts/e97a6e609973-im-bot.json
~/.qclaw/openclaw-weixin/accounts/e97a6e609973-im-bot.context-tokens.json
RAW_BUFFERClick to expand / collapse

Plugin: @tencent/openclaw-weixin Environment: macOS 25.4.0, OpenClaw latest, Node v22.16.0 Account Type: Personal WeChat (not 企业微信), bot_type=3 baseUrl: https://ilinkai.weixin.qq.com Account ID: e97a6e609973-im-bot User ID: [email protected]


Bug Description

Outbound push messages sent via openclaw-weixin channel always report "text sent OK" in Gateway logs and return HTTP success, but the messages are never received by the user's WeChat client.

This affects:

  • Cron jobs (weather reminders, horoscope push, etc.)
  • Any manual message sent via the message tool (outbound push mode)
  • All independent proactive pushes

Important: Inbound works perfectly fine. The user can receive and send messages in conversation. Only outbound push is broken.


Steps to Reproduce

  1. Set up openclaw-weixin plugin with a personal WeChat account (scan QR code login)
  2. Create a cron job with channel set to openclaw-weixin
  3. Wait for the cron job to trigger — or manually send a message via the message tool
  4. Observe: Gateway logs show "text sent OK" but the user never receives the message

Gateway Log Evidence

gateway/channels/openclaw-weixin outbound: [email protected] contextToken=AARzJW...(len=136) textLen=194 mediaUrl=none
gateway/channels/openclaw-weixin outbound: text sent OK [email protected]

The contextToken (AARzJW...) is always the same, even after re-authentication.


Root Cause Investigation

Attempted fixes:

  1. Re-authenticated via QR code (11:01 AM): New account e97a6e609973-im-bot was created. Gateway logs confirm:

    ✅ Login confirmed! [email protected]
    clearStaleAccountsForUserId: removing stale account=bdfa73875fac-im-bot
    clearContextTokensForAccount: cleared tokens for account=bdfa73875fac-im-bot

    But the new account's context-tokens.json file still contains the old contextToken (AARzJW...) — the token was not refreshed after new login.

  2. Restarted Gateway: Cleared the context tokens file and restarted, but the old token is still used for sending.

  3. Checked delivery-queue/failed/: Empty — the gateway believes all deliveries succeeded.

Files examined:

~/.qclaw/openclaw-weixin/accounts/e97a6e609973-im-bot.json
~/.qclaw/openclaw-weixin/accounts/e97a6e609973-im-bot.context-tokens.json

The account file was correctly updated with the new token after re-authentication, but the context token file was NOT updated with a new session token.


Technical Analysis

The openclaw-weixin plugin uses two types of tokens:

  1. Account token ([email protected]:060000a3...) — stored in *.json, correctly refreshed after re-auth
  2. Context token (AARzJW…, len=136) — stored in *.context-tokens.json, NOT refreshed after re-auth

The context token is used for the WebSocket session and outbound message sending. The bug appears to be:

The new QR code login successfully creates a new account and updates the account token, but does NOT fetch a new context token for the user session. The old context token (from before re-auth) is retained and reused, causing all outbound messages to fail silently.

Additionally: WeChat's API appears to accept these messages at the HTTP layer (returning success), but silently discards them because the context token is stale or invalid for outbound push.


Expected vs Actual Behavior

ExpectedActual
Gateway logsSuccessSuccess ("text sent OK")
Message received in WeChat✅ Yes❌ No
delivery-queue/failed/Should contain failed messagesEmpty (gateway thinks it succeeded)

Environment Details

  • OS: macOS 25.4.0 (arm64)
  • Host: SoAK's Mac Studio
  • Node: v22.16.0
  • Gateway: launchd service (PID 91037)
  • Plugin: @tencent/openclaw-weixin (built-in)
  • baseUrl: https://ilinkai.weixin.qq.com
  • bot_type: 3 (personal account)

Possible Fixes Needed

  1. After QR code re-authentication, the plugin should fetch a new context token and update *.context-tokens.json
  2. Or: detect stale context tokens and refresh them before sending outbound messages
  3. Or: if personal WeChat accounts cannot support outbound push via this protocol, document this limitation clearly and show a warning/error instead of "sent OK"

Workaround

Users can fall back to asking the AI directly in conversation (inbound works fine). Cron job notifications need to be delivered via alternative channels (e.g., email) until this bug is fixed.

extent analysis

TL;DR

The most likely fix is to update the @tencent/openclaw-weixin plugin to fetch a new context token after QR code re-authentication and update the *.context-tokens.json file.

Guidance

  • Verify that the *.context-tokens.json file is being updated with a new context token after re-authentication.
  • Check the plugin's code to ensure it is handling the context token refresh correctly.
  • Consider adding a check to detect stale context tokens and refresh them before sending outbound messages.
  • If the issue persists, try falling back to an alternative channel for cron job notifications, such as email.

Example

No code snippet is provided as the issue is related to the plugin's internal functionality and requires a deeper understanding of the codebase.

Notes

The issue seems to be specific to the @tencent/openclaw-weixin plugin and its handling of context tokens. The fact that inbound messages work fine suggests that the issue is isolated to outbound push messages.

Recommendation

Apply a workaround by using an alternative channel for cron job notifications, such as email, until the plugin is updated to handle context token refresh correctly. This will ensure that users receive important notifications while the issue is being resolved.

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 [Bug] openclaw-weixin: outbound push reports success but never delivers to personal WeChat accounts [2 comments, 2 participants]