openclaw config set plugins.entries.openclaw-weixin.enabled true
3. QR code login
openclaw channels login --channel openclaw-weixin
A QR code will appear in the terminal. Scan it with your phone and confirm the authorization. Once confirmed, the login credentials will be saved locally automatically — no further action is needed.
4. Restart the gateway
openclaw gateway restart
Adding More WeChat Accounts
openclaw channels login --channel openclaw-weixin
Each QR code login creates a new account entry, supporting multiple WeChat accounts online simultaneously.
Multi-Account Context Isolation
openclaw-weixin-dsh · DSH Hub
By default, DMs can share one session bucket. For multiple logged-in WeChat accounts, isolate by account + channel + sender:
openclaw config set session.dmScope per-account-channel-peer
Custom BotAgent (optional)
Every outbound request to the WeChat backend carries a self-declared bot_agent
identifier — analogous to an HTTP User-Agent — used for log attribution and
monitoring aggregation. The default is OpenClaw. Declaring your own app name
makes it much easier to trace your traffic in backend logs.
Each token may optionally be followed by (comment)
ASCII only; total length ≤ 256 bytes
Invalid tokens are silently dropped during sanitization; falls back to
OpenClaw if nothing valid remains
Examples that pass through unchanged:
MyBot/1.2.0
MyBot/1.2.0 (region=cn;env=prod)
MyBot/1.2.0 LangChain/0.3.5
MyBot/1.2.0-rc.1+build.5
Note: bot_agent is for observability only — it is not used for
authentication or routing. All registered agents on this plugin instance
currently share the same botAgent declaration; per-agent overrides may be
added in a future version if needed.
Backend API Protocol
This plugin communicates with the backend gateway via HTTP JSON API. Developers integrating with their own backend need to implement the following interfaces.
All endpoints use POST with JSON request and response bodies. Common request headers:
Header
Description
Content-Type
application/json
AuthorizationType
Fixed value ilink_bot_token
Authorization
Bearer (obtained after login)
X-WECHAT-UIN
Base64-encoded random uint32
Endpoint List
Endpoint
Path
Description
getUpdates
getupdates
Long-poll for new messages
sendMessage
sendmessage
Send a message (text/image/video/file)
getUploadUrl
getuploadurl
Get CDN upload pre-signed URL
getConfig
getconfig
Get account config (typing ticket, etc.)
sendTyping
sendtyping
Send/cancel typing status indicator
getUpdates
Long-polling endpoint. The server responds when new messages arrive or on timeout.
Request body:
{
"get_updates_buf": ""
}
Field
Type
Description
get_updates_buf
string
Sync cursor from the previous response; empty string for the first request
Ensure plugins.entries.openclaw-weixin.enabled is true in ~/.openclaw/openclaw.json:
openclaw config set plugins.entries.openclaw-weixin.enabled true
openclaw gateway restart
DeepSeek Harness integration (src/dsh/)
This branch keeps the OpenClaw plugin entry (index.ts) intact and adds a DSH
adapter under src/dsh/: WeChat messages are handled by DeepSeek Harness
Agents/Sessions, with a dedicated WeChat control panel in DSH Settings
(account QR login, monitor start/stop, agent routing, allowlist approval,
message log, configuration).
Dependencies (@deepseek-ai/dsh-session, cordis, react, …) are optional
peers; the OpenClaw side is unaffected.
Note: src/dsh/client.tsx is a reference port of the verified dynamic-plugin
prototype; for real-package mounting follow the "Client wiring" section in
docs/dsh.md (connection.api.weixin.* via TypertRemoteService).