hermes - ✅(Solved) Fix Weixin/iLink setup exposes group chat policy, but QR-login bot cannot be pulled into ordinary WeChat groups [1 pull requests, 1 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
NousResearch/hermes-agent#17094Fetched 2026-04-29 06:37:15
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×4cross-referenced ×1

The Weixin / iLink gateway setup currently exposes group-chat configuration options, including WEIXIN_GROUP_POLICY and WEIXIN_GROUP_ALLOWED_USERS. The setup prompt says:

How should group chats be handled?
- Disable group chats (recommended)
- Allow all group chats
- Only allow listed group chat IDs

However, in our Windows environment, QR login creates/connects an iLink bot identity such as:

This bot identity can receive messages through its iLink bot DM entry, but it cannot be invited into an ordinary WeChat group like a normal WeChat contact. Messages sent in ordinary WeChat groups, including @ mentions of the personal WeChat account used for QR login, do not reach Hermes.

This made the setup/configuration misleading. We spent significant time debugging WEIXIN_GROUP_POLICY, WEIXIN_GROUP_ALLOWED_USERS, and WEIXIN_GROUP_MENTION_ONLY, but the problem was not Hermes filtering. The iLink API simply did not deliver ordinary group messages to the gateway.

Root Cause

The Weixin / iLink gateway setup currently exposes group-chat configuration options, including WEIXIN_GROUP_POLICY and WEIXIN_GROUP_ALLOWED_USERS. The setup prompt says:

How should group chats be handled?
- Disable group chats (recommended)
- Allow all group chats
- Only allow listed group chat IDs

However, in our Windows environment, QR login creates/connects an iLink bot identity such as:

This bot identity can receive messages through its iLink bot DM entry, but it cannot be invited into an ordinary WeChat group like a normal WeChat contact. Messages sent in ordinary WeChat groups, including @ mentions of the personal WeChat account used for QR login, do not reach Hermes.

This made the setup/configuration misleading. We spent significant time debugging WEIXIN_GROUP_POLICY, WEIXIN_GROUP_ALLOWED_USERS, and WEIXIN_GROUP_MENTION_ONLY, but the problem was not Hermes filtering. The iLink API simply did not deliver ordinary group messages to the gateway.

Fix Action

Fixed

PR fix notes

PR #17105: docs(weixin): clarify QR-login iLink bot DM-only group delivery (#17094)

Description (problem / solution / changelog)

Summary

  • Setup wizard prints an explicit note before the group-chat prompt explaining that the QR-login flow connects an iLink bot identity ([email protected]), which cannot be invited into ordinary WeChat groups the way a normal contact can — and that iLink's getUpdates typically returns zero ordinary-group messages even when WEIXIN_GROUP_POLICY=open or allowlist.
  • Open + allowlist confirmations are qualified with "subject to iLink delivering group events" so the user knows the policy is necessary-but-not-sufficient.
  • website/docs/user-guide/messaging/weixin.md adds a :::warning callout in Group Policy and updates the Troubleshooting row for "Bot ignores group messages" with the same caveat.

The bug

Reporter on #17094 ran hermes gateway setup, completed Weixin QR login, and saw:

How should group chats be handled?
- Disable group chats (recommended)
- Allow all group chats
- Only allow listed group chat IDs

…then spent significant time debugging WEIXIN_GROUP_POLICY, WEIXIN_GROUP_ALLOWED_USERS, and WEIXIN_GROUP_MENTION_ONLY to make ordinary WeChat group messages reach the agent. Their gateway logs show that the bot is correctly connected and DM messages flow end-to-end, but ordinary group messages never arrive at the gateway in the first place:

[Weixin] getUpdates response ret=0 errcode=0 msgs=0 sync_buf_changed=True

The root cause is that QR login binds an iLink bot identity, not a fully automated personal WeChat account, and that bot identity cannot be added to ordinary WeChat groups by users. There is nothing for Hermes to filter; iLink simply doesn't deliver group events for this bot type. The setup wizard / docs didn't say this, so users naturally assumed Hermes was filtering.

The fix

Pure docs/help correctness — no runtime behavior changes:

  1. hermes_cli/gateway.py::_setup_weixin adds a 6-line print_info block before the group-chat prompt that names the iLink bot identity, states ordinary groups may not deliver, and recommends leaving group chats disabled unless the user has confirmed iLink is forwarding group events. The "All group chats enabled" warning and "Group allowlist saved" success line are qualified with "(subject to iLink delivering group events)".
  2. website/docs/user-guide/messaging/weixin.md:
    • Group Policy section gains a :::warning Ordinary WeChat groups may not be delivered for QR-login bots callout that explains the iLink bot identity, the typical msgs=0 behavior, and that @-mentioning the personal WeChat account used for QR login is not the same as @-mentioning the iLink bot.
    • Troubleshooting row "Bot ignores group messages" now points at the new callout instead of just suggesting WEIXIN_GROUP_POLICY=open.

The default WEIXIN_GROUP_POLICY=disabled is unchanged. No env-var rename, no startup warning emission, no behavioral change for existing deployments — only setup-time messaging and docs.

Test plan

  • Regression test: tests/gateway/test_setup_weixin.py drives _setup_weixin() through all three group-policy branches with the QR qr_login / check_weixin_requirements / asyncio.run patched, captures print_info and print_warning calls via MagicMock, and asserts:
    • disabled path: info contains both iLink bot + @im.bot + ordinary WeChat group
    • open path: info contains iLink bot and the warning is qualified with iLink
    • allowlist path: info contains iLink bot and WEIXIN_GROUP_POLICY=allowlist is still saved
  • Adjacent suite: tests/gateway/test_setup_feishu.py, tests/hermes_cli/test_setup.py, tests/hermes_cli/test_setup_prompt_menus.py, tests/gateway/test_weixin.py — all pass (78 tests, 0 failures).
  • Regression guard: the test asserts on the iLink bot literal which only exists in the new info block — removing the new lines fails the test.

Related

  • Fixes #17094
  • Adjacent (no overlap): #16422 (weixin: fail fast on permanent iLink error codes), #11634 (weixin Batch-5 polish — merged).

Changed files

  • hermes_cli/gateway.py (modified, +8/-2)
  • tests/gateway/test_setup_weixin.py (added, +101/-0)
  • website/docs/user-guide/messaging/weixin.md (modified, +12/-1)

Code Example

How should group chats be handled?
- Disable group chats (recommended)
- Allow all group chats
- Only allow listed group chat IDs

---

a5ace6fd482e@im.bot

---

[Weixin] raw inbound before filters: {
  "from_user_id": "[email protected]",
  "to_user_id": "[email protected]",
  "group_id": "",
  "message_type": 1,
  "item_list": [{"text_item": {"text": "..."}}],
  "context_token": "***"
}
[Weixin] inbound ... type=dm
inbound message: platform=weixin ...

---

[Weixin] getUpdates response ret=0 errcode=0 msgs=0 sync_buf_changed=True
RAW_BUFFERClick to expand / collapse

Environment

  • OS: Windows Server 2022 Datacenter 10.0.20348
  • Hermes home: C:\Users\Administrator\AppData\Local\hermes
  • Gateway mode: Windows background process using PowerShell Start-Process -FilePath "hermes" -ArgumentList "gateway run"
  • Weixin adapter: iLink bot API / QR login
  • Hermes version: TODO: paste output of hermes version
  • Python version: TODO: paste output of python --version or Hermes runtime Python version

Summary

The Weixin / iLink gateway setup currently exposes group-chat configuration options, including WEIXIN_GROUP_POLICY and WEIXIN_GROUP_ALLOWED_USERS. The setup prompt says:

How should group chats be handled?
- Disable group chats (recommended)
- Allow all group chats
- Only allow listed group chat IDs

However, in our Windows environment, QR login creates/connects an iLink bot identity such as:

This bot identity can receive messages through its iLink bot DM entry, but it cannot be invited into an ordinary WeChat group like a normal WeChat contact. Messages sent in ordinary WeChat groups, including @ mentions of the personal WeChat account used for QR login, do not reach Hermes.

This made the setup/configuration misleading. We spent significant time debugging WEIXIN_GROUP_POLICY, WEIXIN_GROUP_ALLOWED_USERS, and WEIXIN_GROUP_MENTION_ONLY, but the problem was not Hermes filtering. The iLink API simply did not deliver ordinary group messages to the gateway.

Evidence from debugging

We temporarily added a raw inbound log at the very beginning of WeixinAdapter._process_message(), before sender checks, deduplication, group policy checks, allowlist checks, and text/media parsing.

For a successful iLink bot DM, logs showed a raw inbound event like:

[Weixin] raw inbound before filters: {
  "from_user_id": "[email protected]",
  "to_user_id": "[email protected]",
  "group_id": "",
  "message_type": 1,
  "item_list": [{"text_item": {"text": "..."}}],
  "context_token": "***"
}
[Weixin] inbound ... type=dm
inbound message: platform=weixin ...

For ordinary WeChat group messages and @ mentions, no raw inbound log appeared at all.

We then added a lower-level poll log immediately after _get_updates(...). During repeated group-message tests, iLink returned successful responses but no messages:

[Weixin] getUpdates response ret=0 errcode=0 msgs=0 sync_buf_changed=True

This confirms that the messages were not filtered by Hermes. They were not delivered by iLink to the gateway.

Why this is confusing

  1. The adapter is described in setup as Weixin / WeChat personal accounts.
  2. QR login uses a personal WeChat account, which makes users expect ordinary personal WeChat conversations or groups to work.
  3. The generated config includes group-chat policy variables.
  4. WEIXIN_GROUP_ALLOWED_USERS sounds like a user allowlist, but setup text says it is actually a list of group chat IDs.
  5. In practice, the connected identity is an iLink bot ([email protected]), not a normal personal WeChat account that can be pulled into ordinary WeChat groups.

Requested changes

Please clarify the Weixin/iLink adapter documentation and setup prompts:

  1. Explicitly state whether ordinary WeChat group chats are supported for QR-login iLink bots.
  2. If ordinary groups are not supported, say that Weixin/iLink currently supports iLink bot DM only in this mode.
  3. Make clear that @ mentioning the personal WeChat account used for QR login is not the same as @ mentioning the Hermes/iLink bot.
  4. Consider hiding or disabling the group-chat setup prompt for Weixin unless the current iLink credentials/account type actually support group events.
  5. Rename or document WEIXIN_GROUP_ALLOWED_USERS as group chat IDs, not group member user IDs.
  6. Consider adding a startup warning when WEIXIN_GROUP_POLICY is not disabled, explaining that group delivery depends on iLink providing group events and ordinary WeChat groups may not work.

Suggested wording

Weixin/iLink QR login connects Hermes to an iLink bot identity, not to a fully automated ordinary personal WeChat account. In this mode, Hermes can receive messages sent to the iLink bot DM entry. Ordinary WeChat group messages and @ mentions of the QR-login personal account may not be delivered to Hermes unless iLink returns group events for your account/bot type.

Impact

The current UI/config caused a long and confusing debugging session. The gateway was running correctly, Weixin was connected, and DM messages to the bot worked, but ordinary group messages never reached Hermes. Clear documentation would prevent users from spending time debugging allowlists or gateway restarts for a capability that may not be supported by the iLink bot identity.

extent analysis

TL;DR

The Weixin/iLink adapter documentation and setup prompts need to be clarified to reflect that ordinary WeChat group chats are not supported for QR-login iLink bots.

Guidance

  • Update the Weixin/iLink adapter documentation to explicitly state the limitations of QR-login iLink bots, including the lack of support for ordinary WeChat group chats.
  • Modify the setup prompts to clearly indicate that Weixin/iLink currently supports iLink bot DM only in this mode.
  • Consider adding a startup warning when WEIXIN_GROUP_POLICY is not disabled, explaining that group delivery depends on iLink providing group events and ordinary WeChat groups may not work.
  • Rename or document WEIXIN_GROUP_ALLOWED_USERS as group chat IDs, not group member user IDs, to avoid confusion.

Example

No code changes are required, but the documentation and setup prompts need to be updated to reflect the correct functionality of the Weixin/iLink adapter.

Notes

The issue is caused by a misunderstanding of the Weixin/iLink adapter's capabilities, and the solution is to clarify the documentation and setup prompts to reflect the actual functionality.

Recommendation

Apply workaround: Update the documentation and setup prompts to reflect the correct functionality of the Weixin/iLink adapter, as this will help prevent similar issues in the future.

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