hermes - 💡(How to fix) Fix [Weixin] Messages silently dropped under iLink rate limiting due to insufficient backoff [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…

When the WeChat iLink API returns ret=-2, errcode=-2, errmsg="rate limited", the weixin adapter retries with a fixed 3-second backoff per attempt (_send_chunk_retry_delay_seconds * 3), regardless of attempt count. With 4 default retries, the total wait window is only ~12 seconds.

Typical WeChat rate-limit windows are 15-30 seconds or longer, so the adapter exhausts all retries before the limit clears. The message is then silently dropped (SendResult(success=False)).

Error Message

  1. The error appears as missing replies in WeChat — the web-ui shows Compare with the generic exception retry on line 1653: error path — a fixed multiplier instead of attempt-proportional.

Root Cause

In gateway/platforms/weixin.py, _send_text_chunk() line 1637:

wait = self._send_chunk_retry_delay_seconds * 3  # always 3s

Compare with the generic exception retry on line 1653:

wait = self._send_chunk_retry_delay_seconds * (attempt + 1)  # 1s, 2s, 3s, 4s

The rate-limit path actually has worse backoff than the generic error path — a fixed multiplier instead of attempt-proportional.

Fix Action

Fixed

Code Example

wait = self._send_chunk_retry_delay_seconds * 3  # always 3s

---

wait = self._send_chunk_retry_delay_seconds * (attempt + 1)  # 1s, 2s, 3s, 4s
RAW_BUFFERClick to expand / collapse

Description

When the WeChat iLink API returns ret=-2, errcode=-2, errmsg="rate limited", the weixin adapter retries with a fixed 3-second backoff per attempt (_send_chunk_retry_delay_seconds * 3), regardless of attempt count. With 4 default retries, the total wait window is only ~12 seconds.

Typical WeChat rate-limit windows are 15-30 seconds or longer, so the adapter exhausts all retries before the limit clears. The message is then silently dropped (SendResult(success=False)).

Steps to reproduce

  1. Send multiple messages in quick succession via WeChat bot
  2. When the iLink platform rate-limits the bot, messages start failing
  3. The error appears as missing replies in WeChat — the web-ui shows the agent responded successfully, but the message never appears in the WeChat chat window

Screenshots

Web-UI (reply was generated)WeChat (missing reply)
webuiweixin

The left screenshot shows the web-ui confirming that Hermes generated the reply successfully. The right screenshot shows the WeChat chat window where the agent's reply is missing — the message was generated but failed to deliver.

Root cause

In gateway/platforms/weixin.py, _send_text_chunk() line 1637:

wait = self._send_chunk_retry_delay_seconds * 3  # always 3s

Compare with the generic exception retry on line 1653:

wait = self._send_chunk_retry_delay_seconds * (attempt + 1)  # 1s, 2s, 3s, 4s

The rate-limit path actually has worse backoff than the generic error path — a fixed multiplier instead of attempt-proportional.

Proposed fix

  1. Exponential backoff with jitter for rate-limit retries
  2. Parse server-supplied retry_after hints from the iLink response
  3. Chat-level cooldown to prevent cascading chunk failures
  4. Configurable via env vars / config.yaml

See PR for implementation.

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 [Weixin] Messages silently dropped under iLink rate limiting due to insufficient backoff [1 pull requests]