feat: WeChat platform adapter via WeixinClawBot (closes #2422) - #2425
Closed
Mibayy wants to merge 1 commit into
Closed
feat: WeChat platform adapter via WeixinClawBot (closes #2422)#2425Mibayy wants to merge 1 commit into
Mibayy wants to merge 1 commit into
Conversation
Implements full WeChat integration using the WeixinClawBot OpenClaw API, which provides official bot support for WeChat (announced March 2026). Changes: - gateway/platforms/wechat.py — WeChatAdapter with long-polling, dedup, send/send_image/get_chat_info, _redact_openid for safe logging - gateway/config.py — Platform.WECHAT enum + WECHAT_BOT_TOKEN env override - gateway/run.py — adapter factory, authorization maps, toolset routing - gateway/channel_directory.py — session-based chat discovery - agent/prompt_builder.py — PLATFORM_HINTS["wechat"] (plain text, 2048 char limit) - toolsets.py — hermes-wechat toolset + hermes-gateway composite - cron/scheduler.py — deliver="wechat" support - tools/send_message_tool.py — _send_wechat() + platform routing - hermes_cli/status.py — WeChat in status display - hermes_cli/gateway.py — WeChat in setup wizard - tests/gateway/test_wechat.py — 18 tests covering enum, config, adapter, dedup, message dispatch, send, auth maps, toolset Closes NousResearch#2422
Contributor
|
Closing — the gateway scaffolding (config, toolsets, cron routing, dedup, tests) is well done and follows our platform patterns, but the backend depends on OpenClaw's WeixinClawBot service which isn't viable as a dependency for a competitor's product. When we build WeChat support, we'll target the Official Account API or Enterprise WeChat (WeCom) API directly. The scaffolding from this PR will be a useful reference for that. Thanks for the thorough implementation! |
2 tasks
19 tasks
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 full WeChat support using the WeixinClawBot OpenClaw API — the official bot integration channel announced by WeChat in March 2026.
Closes #2422
What's included
Following the checklist in
ADDING_A_PLATFORM.md, all 15 integration points are covered:gateway/platforms/wechat.pygateway/config.pyPlatform.WECHATenum +WECHAT_BOT_TOKENenv override + home channelgateway/run.py_create_adapter)gateway/run.pyWECHAT_ALLOWED_USERS,WECHAT_ALLOW_ALL_USERS)gateway/run.pydefault_toolset_mapinstances)gateway/channel_directory.pyagent/prompt_builder.pyPLATFORM_HINTS["wechat"]— plain text, 2048 char limittoolsets.pyhermes-wechattoolset + added tohermes-gatewaycompositecron/scheduler.pydeliver="wechat"supporttools/send_message_tool.py_send_wechat()+ platform routinghermes_cli/status.pyhermes statusdisplayhermes_cli/gateway.pytests/gateway/test_wechat.pyConfiguration
Or via
config.yaml:How it works
WeixinClawBot acts as a bridge — you connect your WeChat account via QR code scan on their dashboard, and they expose a REST API + long-polling endpoint that the adapter uses to receive and send messages.
The adapter polls
GET /v1/messagesevery 500ms, dispatches text messages through the standardhandle_messageflow, and sends replies viaPOST /v1/messages/send. Non-text messages (images, voice, etc.) are silently skipped for now.Tests