Introduction¶
DeepSeek Harness (DSH) adopts a plugin-based architecture, designed to provide a unified development and runtime environment for various agents. When developers use DSH to build applications, they often need to integrate with multiple messaging channels. dsh-weixin is a channel plugin based on Tencent’s iLink Bot API, which allows DSH to directly send and receive messages through personal WeChat, bypassing complex third-party gateway configurations.
Plugin Overview¶
This plugin was developed by maintainer 5havv and is released under the MIT license. It is integrated as an npm package and is of the same origin and protocol as Tencent’s official openclaw-weixin and Hermes’ WeChat adapter. The plugin is currently at the v0.2 / M1–M4 stage, implementing QR code login, long polling, and basic message send/receive capabilities.
Core Features¶
Based on the iLink Bot API, this plugin provides the following core capabilities:
- Message send/receive: Supports sending and receiving text, images, files, voice messages, and videos. Inbound media is automatically downloaded, decrypted, and cached; images can be directly passed to the vision model, and voice messages receive transcription text delivered by Tencent’s backend.
- Independent sessions: Supports
per-peermode, meaning each contact has an independent agent/session without interference. - Tool calls: Registers the
weixin_sendtool, allowing the agent to proactively send messages to specific contacts. - Login method: Supports terminal QR code login, requiring no public IP address or WebSocket.
- Credential reuse: Supports importing credentials for the same account from Hermes, avoiding repeated QR code scanning.
Installation and Activation¶
After the plugin is installed, DSH will load two independent Cordis plugin components: weixin (responsible for channel services and tools) and weixin-bridge (responsible for message routing and orchestration).
Official Installation Command¶
dsh plugin --profile web add @5havv/dsh-weixin
Development Overlay (Optional)¶
For local debugging, you can use the overlay mode, but the project must be built first:
npm run build
dsh --profile web --patch ./examples/cordis.dev.yml
Typical Usage¶
After installation, you can perform basic connectivity tests via npm scripts.
QR Code Login¶
npm run smoke -- login
This command generates a QR code in the terminal; after scanning, account information is saved.
Message Listening and Send/Receive¶
# Listen and print inbound messages (including media download and decryption)
npm run smoke -- listen
# Send text to a specified account
npm run smoke -- send <accountId> <toUserId> 'hello'
# Send a local file
npm run smoke -- sendfile <accountId> <toUserId> ./photo.png 'Look at this picture'
Use Cases and Considerations¶
Use Cases¶
- Private chat scenarios: This plugin uses a personal WeChat / iLink bot identity. Most account types cannot receive ordinary WeChat group messages; only private chats are stably available.
System Limitations¶
- Single instance: Only one consumer can be online simultaneously with the same token. This plugin uses a file lock mechanism to ensure this; if two instances start simultaneously, an error will be reported.
- Session refresh: If a contact has not sent a message for a long time, the
context_tokenwill become invalid. Sending a message will automatically fall back and retry at this time; if it still fails, the other party needs to send a message first to activate the session. - Runtime environment: The plugin depends on the Node.js environment and requires version >= 22.
Security Notes¶
The weixin_send tool registered by the plugin allows the model to call local file paths. To prevent data exfiltration, this path is restricted to the mediaSendRoots whitelist. The default values are the process working directory and the media cache directory. If the WeChat account may receive untrusted messages, it is recommended to narrow this to a dedicated directory.
Conclusion¶
dsh-weixin provides native WeChat connectivity for the DSH ecosystem, suitable for developers who need to run DSH agents in a WeChat environment. Through QR code login and tool integration, it can quickly set up WeChat-based automated services.