hermes - ✅(Solved) Fix [Feature]: Add local WeChat gateway adapter via wechat-bridge --shape hermes [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#14421Fetched 2026-04-24 06:17:23
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3referenced ×2cross-referenced ×1

Add a new wechat gateway platform for Hermes Agent, backed by the local wechat-bridge --shape hermes interface from leeguooooo/wechat-skill.

This is not the same as the existing weixin adapter in Hermes. The current weixin adapter targets Tencent iLink / bot-style integration, while this request is for a local personal WeChat account bridge running on the same machine.

Error Message

Error shape

{ "error": "short_code", "message": "human string" }

  • explicitly invited feedback if field names / error codes need further alignment

Root Cause

This is a good moment to do it because the upstream bridge author has:

Fix Action

Fixed

PR fix notes

PR #14461: Add local WeChat gateway adapter via wechat-bridge

Description (problem / solution / changelog)

Closes #14421

Why

Hermes already supports several personal and workspace messaging platforms, but it does not yet have a first-class adapter for a local personal WeChat account.

This change adds a wechat gateway platform backed by the local wechat-bridge --shape hermes contract exposed by leeguooooo/wechat-skill. Hermes integrates only with the local HTTP/SSE bridge surface; it does not need to understand WeChat protocol details directly.

What

  • add Platform.WECHAT configuration and environment/bootstrap wiring
  • add gateway/platforms/wechat.py for local bridge health, SSE inbound stream handling, text send, and chat/history lookups
  • wire the adapter into gateway/run.py
  • register WeChat in channel discovery, CLI status, and toolset selection
  • allow send_message direct delivery to WeChat targets and home channels
  • add adapter-focused tests in tests/gateway/platforms/test_wechat.py

Scope / Non-goals

  • replyTo and typing are not implemented as real WeChat actions; the bridge explicitly reports them as unsupported (501) and the Hermes adapter degrades accordingly
  • this integration targets the local macOS WeChat bridge workflow, currently macOS Apple Silicon only
  • activation/subscription enforcement stays server-authoritative in the bridge; Hermes only consumes the bridge contract
  • this PR does not modify the existing weixin adapter, which remains the Tencent iLink / official-style integration path

Test Plan

  • pytest -o addopts='' tests/gateway/platforms/test_wechat.py -q
  • python3 -m py_compile gateway/platforms/wechat.py gateway/config.py gateway/run.py tools/send_message_tool.py toolsets.py hermes_cli/status.py gateway/channel_directory.py
  • smoke import under Python 3.11:
    • python3.11 -c "from gateway.config import Platform; assert Platform.WECHAT"
    • python3.11 -c "from gateway.platforms import wechat"

Local maintainer try-out:

  1. Install wechat-skill v1.10.2 or newer from https://github.com/leeguooooo/wechat-skill
  2. Start the local bridge: wechat-bridge --shape hermes
  3. Set WECHAT_ENABLED=true
  4. Optionally set WECHAT_BRIDGE_HOST, WECHAT_BRIDGE_PORT, and WECHAT_BRIDGE_BEARER
  5. Start Hermes gateway and send a message to a known WeChat target or home channel

License Note

The bridge repo publishes its own separate license file at https://github.com/leeguooooo/wechat-skill/blob/main/LICENSE. As of April 23, 2026, that file is a non-commercial learning license rather than MIT.

Hermes does not vendor or redistribute that bridge here; this PR only adds interoperability with its local HTTP/SSE interface.

Review Notes

This is a non-trivial gateway surface addition. Review of the adapter shape, bridge-contract assumptions, and reconnect/error-handling paths would be especially valuable.

Changed files

  • gateway/channel_directory.py (modified, +3/-0)
  • gateway/config.py (modified, +93/-0)
  • gateway/platforms/wechat.py (added, +605/-0)
  • gateway/run.py (modified, +13/-3)
  • hermes_cli/platforms.py (modified, +1/-0)
  • hermes_cli/status.py (modified, +1/-0)
  • tests/gateway/platforms/test_wechat.py (added, +210/-0)
  • tests/hermes_cli/test_tools_config.py (modified, +7/-0)
  • tools/send_message_tool.py (modified, +50/-1)
  • toolsets.py (modified, +7/-1)

Code Example

wechat-bridge --shape hermes
# default: 127.0.0.1:18400

---

{
  "status": "delivered" | "submitted_unconfirmed" | "status_unknown" | "failed",
  "wxid": "...",
  "recipient_display_name": "...",
  "delivered_verified": true | false | null,
  "verify_tables_scanned": 10,
  "verify_rows_scanned": 3,
  "reused_session": false,
  "diagnostic": { ... }
}

---

{ "error": "short_code", "message": "human string" }
RAW_BUFFERClick to expand / collapse

Summary

Add a new wechat gateway platform for Hermes Agent, backed by the local wechat-bridge --shape hermes interface from leeguooooo/wechat-skill.

This is not the same as the existing weixin adapter in Hermes. The current weixin adapter targets Tencent iLink / bot-style integration, while this request is for a local personal WeChat account bridge running on the same machine.

Motivation

A working local bridge now exists and already exposes a Hermes-compatible shape. This makes it possible to add WeChat as another first-class Hermes messaging channel, alongside WhatsApp / Feishu / Signal, without Hermes having to understand WeChat internals.

The key point is: Hermes would not integrate against WeChat protocol details directly. It would integrate against a stable local bridge contract, exactly like Hermes already does with its WhatsApp bridge.

Why this should be a separate wechat platform

Hermes already has Platform.WEIXIN and a gateway/platforms/weixin.py, but that path is for Tencent iLink bot / official-style integration. It is not the same thing as a local desktop WeChat bridge for a personal account.

So this request is specifically:

  • add Platform.WECHAT
  • add gateway/platforms/wechat.py
  • wire it into the gateway the same way other platforms are wired

Current upstream state

The upstream bridge author has already added a Hermes-compatible shape in wechat-skill:

  • release: v1.10.2
  • startup: wechat-bridge --shape hermes
  • stability promise: v1.10.x bridge paths / methods / field names / enum values will not break

The bridge author explicitly recommends that Hermes integrate against the bridge directly, instead of using CLI-subprocess mode.

Public bridge contract (already implemented upstream)

Start

wechat-bridge --shape hermes
# default: 127.0.0.1:18400

Transport

  • local HTTP/1.1
  • SSE for inbound stream
  • optional Bearer auth if exposed beyond loopback

Endpoints

  • GET /health
  • GET /messages/stream?since=TS
  • POST /send body { "wxid": "...", "text": "..." }
  • GET /chat/:wxid
  • GET /chat/:wxid/history?limit=N&since=TS&until=TS
  • GET /chats?limit=N&types=private,group
  • GET /unread
  • GET /contacts?query=X&limit=N
  • GET /resolve?hint=X&limit=N

/send response shape

{
  "status": "delivered" | "submitted_unconfirmed" | "status_unknown" | "failed",
  "wxid": "...",
  "recipient_display_name": "...",
  "delivered_verified": true | false | null,
  "verify_tables_scanned": 10,
  "verify_rows_scanned": 3,
  "reused_session": false,
  "diagnostic": { ... }
}

Error shape

{ "error": "short_code", "message": "human string" }

With status codes such as 400, 401, 402, 404, 413, 503.

Hermes-shaped inbound event fields

The upstream --shape hermes stream already exposes fields aligned to Hermes WhatsApp-style expectations, including:

  • messageId
  • chatId
  • senderId
  • senderName
  • chatName
  • isGroup
  • body
  • hasMedia
  • mediaType
  • mediaUrls
  • mentionedIds
  • quotedParticipant
  • botIds
  • timestamp

Local validation (already tested)

This is not speculative. The bridge has already been validated locally on the target machine:

  • wechat-bridge --shape hermes --port 18400 starts successfully
  • GET /health returns Hermes-shaped bridge status
  • GET /chat/filehelper works
  • GET /chat/filehelper/history?limit=2 works and returns Hermes-shaped history rows
  • POST /send to filehelper succeeds and history later contains the sent message
  • POST /typing returns 501 not_supported as designed

So the missing piece is now on the Hermes side: adding an adapter and platform wiring.

Proposed Hermes implementation (minimum viable scope)

Add a new wechat gateway adapter that integrates against wechat-bridge --shape hermes:

  1. gateway/config.py

    • add Platform.WECHAT
    • add env/config parsing for bridge host/port/bearer/home channel
  2. gateway/platforms/wechat.py

    • connect to wechat-bridge over local HTTP
    • use /messages/stream (SSE) for inbound delivery
    • use /send for text replies
    • use /chat/:wxid for chat info
    • optional /chat/:wxid/history for future context helpers
    • treat 501 not_supported on typing / reply features as graceful no-op or downgrade
  3. gateway/run.py

    • add adapter factory branch for Platform.WECHAT
    • add authorization env mappings (WECHAT_ALLOWED_USERS, WECHAT_ALLOW_ALL_USERS, etc.)
  4. toolsets.py, send_message_tool.py, channel_directory.py, setup/status surfaces

    • register a hermes-wechat toolset
    • allow message delivery to WeChat home channel
    • include session/channel discovery if appropriate

Feature boundaries / known limitations

The upstream bridge explicitly does not fake unsupported behaviors:

  • POST /typing -> 501 not_supported
  • replyTo on send -> 501 reply_not_supported

So a Hermes adapter should degrade cleanly:

  • typing indicator can be a no-op
  • replies can fall back to plain send or quoted text formatting

Why now

This is a good moment to do it because the upstream bridge author has:

  • already added a Hermes alignment layer (--shape hermes)
  • promised no breaking changes within v1.10.x
  • explicitly invited feedback if field names / error codes need further alignment

That makes the integration risk much lower than designing a fresh protocol.

Ask

Please consider opening support for Platform.WECHAT in Hermes gateway.

If maintainers are open to it, the upstream wechat-skill author may also be willing to help align field names further (or possibly contribute the adapter wiring), since the bridge side is already implemented and tested.

I can provide additional local validation details if needed, but the main point is: the local bridge is already real, stable, and Hermes-shaped; Hermes now needs the adapter.

extent analysis

TL;DR

Add a new wechat gateway platform to Hermes by creating a wechat.py adapter that integrates with the local wechat-bridge interface.

Guidance

  • Create a new Platform.WECHAT in gateway/config.py and add environment/config parsing for bridge host, port, bearer, and home channel.
  • Develop a gateway/platforms/wechat.py adapter to connect to wechat-bridge over local HTTP, using /messages/stream for inbound delivery and /send for text replies.
  • Update gateway/run.py to add an adapter factory branch for Platform.WECHAT and authorization environment mappings.
  • Register a hermes-wechat toolset in toolsets.py and allow message delivery to the WeChat home channel.

Example

# gateway/platforms/wechat.py
import requests

class WeChatAdapter:
    def __init__(self, host, port, bearer):
        self.host = host
        self.port = port
        self.bearer = bearer

    def send_message(self, wxid, text):
        url = f"http://{self.host}:{self.port}/send"
        headers = {"Authorization": f"Bearer {self.bearer}"}
        data = {"wxid": wxid, "text": text}
        response = requests.post(url, headers=headers, json=data)
        return response.json()

Notes

The upstream bridge author has already implemented a Hermes-compatible shape and promised no breaking changes within v1.10.x, making this integration relatively low-risk.

Recommendation

Apply the proposed implementation by adding the wechat gateway platform and adapter, as the local bridge is already stable and Hermes-shaped.

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 - ✅(Solved) Fix [Feature]: Add local WeChat gateway adapter via wechat-bridge --shape hermes [1 pull requests, 1 participants]