hermes - 💡(How to fix) Fix WeCom: ercode 846609 — session-level WebSocket disconnects before reply, causing silent delivery failures [1 pull requests]

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…

Error Message

20:41:04 [session] Connected to wss://openws.work.weixin.qq.com 20:41:06 [session] Disconnected (1.5 seconds later) 20:41:11 response ready: 31 chars 20:41:11 ERROR: ercode 846609: aibot websocket not subscribed 20:41:11 ERROR: Fallback send also failed: ercode 846609

Root Cause

WeCom (企业微信) replies frequently fail with ercode 846609 ("aibot websocket not subscribed"). The reply is generated successfully, but the send step fails because WeCom sessions create separate ephemeral WebSocket connections that disconnect before the reply is sent.

Fix Action

Fixed

Code Example

20:41:04  [session] Connected to wss://openws.work.weixin.qq.com
20:41:06  [session] Disconnected  (1.5 seconds later)
20:41:11  response ready: 31 chars
20:41:11  ERROR: ercode 846609: aibot websocket not subscribed
20:41:11  ERROR: Fallback send also failed: ercode 846609

---

10:51:10  Connect10:51:10  Disconnect (0.3s)
11:35:26  Connect11:35:27  Disconnect (1.2s)
14:53:16  Connect14:53:16  Disconnect (0.4s)
15:32:05  Connect15:32:06  Disconnect (1.4s)
20:47:01  Connect20:47:02  Disconnect (1.5s)
RAW_BUFFERClick to expand / collapse

Bug Description

WeCom (企业微信) replies frequently fail with ercode 846609 ("aibot websocket not subscribed"). The reply is generated successfully, but the send step fails because WeCom sessions create separate ephemeral WebSocket connections that disconnect before the reply is sent.

Evidence

From production on macOS, 173+ occurrences of ercode 846609 in a single day (2026-05-20).

Core Pattern

Session-level WebSocket connects → disconnects in 1-2 seconds → reply send fails:

20:41:04  [session] Connected to wss://openws.work.weixin.qq.com
20:41:06  [session] Disconnected  (1.5 seconds later)
20:41:11  response ready: 31 chars
20:41:11  ERROR: ercode 846609: aibot websocket not subscribed
20:41:11  ERROR: Fallback send also failed: ercode 846609

This repeats constantly, e.g.:

10:51:10  Connect → 10:51:10  Disconnect (0.3s)
11:35:26  Connect → 11:35:27  Disconnect (1.2s)
14:53:16  Connect → 14:53:16  Disconnect (0.4s)
15:32:05  Connect → 15:32:06  Disconnect (1.4s)
20:47:01  Connect → 20:47:02  Disconnect (1.5s)

Meanwhile, the main gateway's persistent WebSocket stays healthy and reconnects fine after drops.

Root Cause Hypothesis

Individual WeCom sessions create their own WebSocket connections for sending replies, instead of reusing the main gateway's persistent WebSocket connection. These session-level connections are ephemeral—they disconnect almost immediately after being established.

Steps to Reproduce

  1. Run Hermes gateway with WeCom platform configured
  2. Send a message to the bot from WeCom
  3. Observe: the WeCom session creates its own WebSocket to wss://openws.work.weixin.qq.com
  4. The session disconnects within 1-2 seconds
  5. Any send attempt after disconnect → ercode 846609

Expected Behavior

Replies should use the main gateway's persistent WebSocket connection, or session-level connections should be kept alive until the send completes.

Environment

  • Hermes Agent on macOS 26.4
  • WeCom bot with home channel configured
  • Multiple concurrent sessions (CLI + WeCom)
  • 846609 errors occur multiple times per hour

Impact

  • User sees complete silence (no error indication on WeCom side)
  • Responses are generated but never delivered (wastes API tokens)
  • Requires manual gateway restart to temporarily recover

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

hermes - 💡(How to fix) Fix WeCom: ercode 846609 — session-level WebSocket disconnects before reply, causing silent delivery failures [1 pull requests]