openclaw - 💡(How to fix) Fix [Bug] openclaw-weixin channel startup blocks main EventLoop (21s+)

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…

Every time the Gateway starts, channels.openclaw-weixin.start-account blocks the main Node.js event loop for ~21 seconds (eventLoopDelayMaxMs=21206ms). During this period, eventLoopUtilization=1 (CPU pegged at 100%), preventing all other channels and model fallback mechanisms from working correctly.

Root Cause

The openclaw-weixin plugin uses synchronous s.*Sync operations in its startup flow. When the event loop is blocked:

  • Session file locks time out (60s) because the event loop can't process
  • Model fallback is triggered incorrectly - not because the primary model (MiniMax M2.7) failed, but because Gateway couldn't acquire the session write lock
RAW_BUFFERClick to expand / collapse

Description

Every time the Gateway starts, channels.openclaw-weixin.start-account blocks the main Node.js event loop for ~21 seconds (eventLoopDelayMaxMs=21206ms). During this period, eventLoopUtilization=1 (CPU pegged at 100%), preventing all other channels and model fallback mechanisms from working correctly.

Evidence

liveness warning: reasons=event_loop_delay interval=46s eventLoopDelayMaxMs=21206.4 eventLoopUtilization=1 cpuCoreRatio=0.884 phase=channels.openclaw-weixin.start-account

Root Cause

The openclaw-weixin plugin uses synchronous s.*Sync operations in its startup flow. When the event loop is blocked:

  • Session file locks time out (60s) because the event loop can't process
  • Model fallback is triggered incorrectly - not because the primary model (MiniMax M2.7) failed, but because Gateway couldn't acquire the session write lock

Files with remaining *Sync calls (33 sync calls in 6 files)

  • src/auth/accounts.ts - 15 sync calls
  • src/auth/pairing.ts - 7 sync calls
  • src/messaging/inbound.ts - 4 sync calls
  • src/messaging/debug-mode.ts - 4 sync calls
  • src/api/api.ts - 2 sync calls
  • src/util/logger.ts - 1 sync call

Suggested Fix

  1. Convert all s.*Sync calls to s/promises async versions
  2. Start weixin channel asynchronously (non-blocking), after other channels have initialized
  3. Or expose a startDelay config option so users can defer weixin startup

Environment

  • OS: Windows
  • Plugin: @tencent-weixin/openclaw-weixin

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 channel startup blocks main EventLoop (21s+)