feat(gateway): add WeChat Official Account platform adapter - #2481
Closed
teknium1 wants to merge 1 commit into
Closed
feat(gateway): add WeChat Official Account platform adapter#2481teknium1 wants to merge 1 commit into
teknium1 wants to merge 1 commit into
Conversation
Adds WeChat support using the official WeChat Official Account API (not third-party bridges). The adapter: - Runs an aiohttp webhook server to receive message pushes from WeChat - Handles WeChat's server verification handshake (SHA1 signature) - Parses XML message payloads into standard MessageEvents - Sends replies via the Customer Service Message API (JSON) - Manages access_token lifecycle (auto-refresh, 2h TTL) - Message deduplication with configurable window - Auto-splits long messages at the 2048 char limit Integration points: - gateway/config.py: Platform.WECHAT enum, env overrides, home channel - gateway/run.py: adapter factory - cron/scheduler.py: deliver=wechat support - agent/prompt_builder.py: plain-text platform hint Configuration: WECHAT_TOKEN (verification token) WECHAT_APP_ID (Official Account AppID) WECHAT_APP_SECRET (Official Account AppSecret) WECHAT_PORT (default: 8680) WECHAT_HOME_CHANNEL / WECHAT_HOME_CHANNEL_NAME
teknium1
force-pushed
the
hermes/hermes-baa39faf
branch
from
March 22, 2026 13:06
84e7a33 to
0dd5d58
Compare
Contributor
Author
|
Holding off on merge — the adapter code works but WeChat Official Account API requires Chinese business registration, ICP filing, and verification that 99% of users can't get. No competitor has shipped WeChat support for the same reason. The code is saved as a reference implementation. When a user with actual WeChat access wants to test, or when we add Enterprise WeChat (WeCom) support (more accessible, where the Tencent+AI momentum actually is), we'll revisit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds WeChat support using the official WeChat Official Account API — no third-party bridges or competitor dependencies.
Replaces PR #2425 which depended on OpenClaw's WeixinClawBot service.
How it works
The adapter runs an aiohttp webhook server. WeChat pushes messages to it via HTTP POST with XML payloads. Replies go back via the Customer Service Message API (JSON).
MessageEventapi.weixin.qq.com/cgi-bin/message/custom/sendConfiguration
WECHAT_TOKEN=your-verification-token WECHAT_APP_ID=wx1234567890abcdef WECHAT_APP_SECRET=your-app-secret # Optional WECHAT_PORT=8680 WECHAT_HOME_CHANNEL=openid_abc123Integration points
gateway/platforms/wechat.pygateway/config.pyPlatform.WECHATenum + env overridesgateway/run.pycron/scheduler.pydeliver=wechatsupportagent/prompt_builder.pyNote
WeChat Official Accounts require verification through WeChat's admin dashboard. Users need a Service Account (not Subscription Account) for the Customer Service Message API. This is China-market focused — international users may find WeChat Work/WeCom more accessible.
Test plan