openclaw - 💡(How to fix) Fix [Bug]: WeChat openclaw-weixin: outbound replies silently dropped when session goes idle ??reproducible on 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#81316Fetched 2026-05-14 03:33:28
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
closed ×1commented ×1cross-referenced ×1

After a conversation goes idle for approximately 30-60 minutes, subsequent AI replies via the openclaw-weixin channel (personal WeChat account, bot_type=3) are silently dropped. The Gateway reports delivery as successful (delivery: pending or deliveryStatus: delivered), but the message never arrives on the recipient's WeChat client.

This is NOT a cron-only issue ??it affects any delayed reply within an existing conversation session.

Error Message

Error: weixin: cannot determine which account to use for to=<user_id> (2 accounts registered, none has an active session with this recipient). Specify accountId in the delivery config, or ensure the recipient has recently messaged the bot. 5. Gateway reports delivered ??no error, no retry, no warning to the user o error = delivered) This is affecting real-world usage where Dr. Xia (a clinician/researcher) relies on the AI for literature searches and document drafting. When she asks a question and the AI takes time to process, the results are frequently lost ??she receives nothing, and neither the AI nor the Gateway reports any error.

Root Cause

Based on investigation of the two registered WeChat accounts:

Account files on disk: ~/.openclaw/openclaw-weixin/accounts/ 3c947a6d5e9d-im-bot.json 3c947a6d5e9d-im-bot.context-tokens.json 96a4a2b44fc7-im-bot.json 96a4a2b44fc7-im-bot.context-tokens.json

The context token (used for WebSocket session and outbound message sending) appears to:

  • Work correctly for immediate replies (within the same active session)
  • Expire after a period of inactivity
  • Not be automatically refreshed by the plugin when it expires
  • Result in silent delivery failure (the Gateway reports success because the upper layers consider o error = delivered)

The context token is stored in *.context-tokens.json and is separate from the account authentication token in *.json. After QR code re-authentication:

  • Account token is refreshed correctly
  • Context token retains the old value ??it is never refreshed

Fix Action

Fix / Workaround

Workaround tested

The only reliable workaround found so far is:

  1. User sends a new message (re-establishes the session)
  2. AI replies within the active window
  3. This is not practical for long-running tasks
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (silent delivery failure)

Summary

After a conversation goes idle for approximately 30-60 minutes, subsequent AI replies via the openclaw-weixin channel (personal WeChat account, bot_type=3) are silently dropped. The Gateway reports delivery as successful (delivery: pending or deliveryStatus: delivered), but the message never arrives on the recipient's WeChat client.

This is NOT a cron-only issue ??it affects any delayed reply within an existing conversation session.

Environment

  • OpenClaw version: 2026.5.6 (c97b9f7)
  • Node.js: v24.15.0
  • OS: Windows 10.0.26200 (x64)
  • Install method: npm global
  • Gateway: local (loopback, port 18789)
  • Gateway startup: Scheduled task with BootTrigger + LogonTrigger (S4U logon type)

Channel plugin

  • Plugin: @tencent-weixin/openclaw-weixin (external plugin, not on ClawHub)
  • Account type: Personal WeChat (bot_type=3)
  • Two accounts affected:

Step-by-step reproduction

  1. Start a conversation via openclaw-weixin (user sends a message, AI replies ??both accounts work fine)
  2. AI acknowledges the user's request (reply arrives immediately ??context token is fresh)
  3. AI takes time processing (15-60 minutes for literature search, document generation, etc.)
  4. AI attempts to deliver the final result back to the user via the same session
  5. Result: Gateway log shows ext sent OK or delivered: true, but the message never appears on the user's WeChat

CLI diagnostic test

openclaw message send --channel openclaw-weixin --target "<user_id>" --account "<account_id>" --message "test"

  • When conversation is active (user messaged within last few minutes):

    • Works correctly ??message arrives on WeChat
  • When conversation is cold (no messages for 30+ minutes):

    • Fails with: Error: weixin: cannot determine which account to use for to=<user_id> (2 accounts registered, none has an active session with this recipient). Specify accountId in the delivery config, or ensure the recipient has recently messaged the bot.

What makes this different from a simple cron/announce issue

This is not just about cron jobs or proactive push messages. This is about session continuity: the AI cannot complete a delayed reply within the same conversation context after a period of inactivity. The most critical use case is:

  1. User: "Search these papers and summarize them"
  2. AI: "Working on it, this will take about 20 minutes"
  3. (20 minutes later, AI finishes the search)
  4. AI sends the result back ??user never receives it
  5. Gateway reports delivered ??no error, no retry, no warning to the user

Root cause analysis

Based on investigation of the two registered WeChat accounts:

Account files on disk: ~/.openclaw/openclaw-weixin/accounts/ 3c947a6d5e9d-im-bot.json 3c947a6d5e9d-im-bot.context-tokens.json 96a4a2b44fc7-im-bot.json 96a4a2b44fc7-im-bot.context-tokens.json

The context token (used for WebSocket session and outbound message sending) appears to:

  • Work correctly for immediate replies (within the same active session)
  • Expire after a period of inactivity
  • Not be automatically refreshed by the plugin when it expires
  • Result in silent delivery failure (the Gateway reports success because the upper layers consider o error = delivered)

The context token is stored in *.context-tokens.json and is separate from the account authentication token in *.json. After QR code re-authentication:

  • Account token is refreshed correctly
  • Context token retains the old value ??it is never refreshed

Expected behavior

The AI should be able to deliver a delayed reply (15-60+ minutes) within the same conversation session, regardless of the idle period. The system should either:

  1. Keep the WebSocket session/context token alive while the AI is actively processing a task
  2. Auto-refresh the context token when it expires
  3. Or at minimum, report a clear delivery failure to the AI and retry, instead of silently dropping the message

Actual behavior

Messages are silently dropped after the session goes cold. The system reports success (delivered: true) but nothing arrives on the recipient's WeChat. The AI has no way to detect the failure and no mechanism to retry.

Workaround tested

The only reliable workaround found so far is:

  1. User sends a new message (re-establishes the session)
  2. AI replies within the active window
  3. This is not practical for long-running tasks

Related reports

  • #79753 (same symptom, still open ??cron announce delivery via WeChat)
  • #68805 (same symptom, closed as "not reproducible after it mysteriously started working" ??but we reproduced it again on 2026.5.6)
  • #78532 (root cause: deliverySucceeded=true when no adapter was invoked) "The amount you have written for the body is: 690

The maximum amount you can write for the body is: 65536

Additional context

This is affecting real-world usage where Dr. Xia (a clinician/researcher) relies on the AI for literature searches and document drafting. When she asks a question and the AI takes time to process, the results are frequently lost ??she receives nothing, and neither the AI nor the Gateway reports any error.

We would be happy to provide additional logs, account configuration details, or run diagnostic tests if needed.

The GitHub token used for this report has public_repo scope only and is stored locally for follow-up.

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

The AI should be able to deliver a delayed reply (15-60+ minutes) within the same conversation session, regardless of the idle period. The system should either:

  1. Keep the WebSocket session/context token alive while the AI is actively processing a task
  2. Auto-refresh the context token when it expires
  3. Or at minimum, report a clear delivery failure to the AI and retry, instead of silently dropping the message

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]: WeChat openclaw-weixin: outbound replies silently dropped when session goes idle ??reproducible on 2026.5.6 [1 comments, 2 participants]