dsh-weixin
> Part of the DSH ecosystem — channel plugins built on the DeepSeek Harness (DSH) plugin architecture.
Personal WeChat channel plugin for the DeepSeek Harness (DSH) — turn dsh into a WeChat bot with one long-lived Agent per chat peer (true rolling memory, flushed to disk).
How it works
This plugin talks directly to WeChat's official iLink Bot API (the same protocol behind Tencent's @tencent-weixin/openclaw-weixin gateway plugin). It uses that Tencent-maintained package as a plain protocol library — no OpenClaw gateway, no forwarding, no cloud relay — and replaces the gateway glue with DSH Agents:
your WeChat ⇄ Tencent iLink API ⇄ this plugin (getUpdates long-poll)
└→ one resident DSH Agent per peer
replies via sendMessage- QR login on first boot: the QR link is printed to the log and written to
<rootDir>/login-qr.txt(render it or open it in WeChat). The flow auto-refreshes expired QRs and retries. - Credentials are stored under
<rootDir>/state/openclaw-weixin/accounts/<bot-id>.json(0600), isolated from any OpenClaw installation viaOPENCLAW_STATE_DIR. - Inbound: every text message wakes the peer's Agent (created lazily, memory spans the process lifetime; sessions persist to the DSH session store).
- Model: whatever the host's default model selection is (
agent-default-modelin~/.dsh/settings.yaml). - Resilient: long-poll timeouts and transport errors back off exponentially (5s→120s) and reconnect.
Install
# 1. Put the bundle where DSH resolves bundles, e.g. the runtime install:
cp -R dsh-weixin ~/.dsh/runtime/node_modules/dsh-weixin
# (plus the protocol dependency, next step)
# 2. Install the iLink protocol library into the same runtime:
cd ~/.dsh/runtime
npm install @tencent-weixin/openclaw-weixin@2.4.6 openclaw
# (`openclaw` satisfies one utility import in the library's logger;
# no gateway is started or used)
# 3. Create ~/.dsh/profiles/weixin/package.json:
# {
# "name": "dsh-profile-weixin",
# "private": true,
# "dependencies": {},
# "dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "dsh-weixin"] } }
# }
# plus empty cordis.yml (`[]`), cordis.patch.yml (`[]`), pnpm-workspace.yaml.
# 4. Boot:
dsh --profile weixinOn first boot it prints a QR link — scan it with your phone WeChat, confirm, and the bridge enters the poll loop. Subsequent boots reuse the saved token.
Configure (optional, via the profile's cordis.patch.yml)
- id: weixin-bridge
config:
rootDir: ~/.dsh/weixin-channel # state + workspace root
accountId: default # logical account label
loginTimeoutSeconds: 240 # per-attempt QR wait
minBackoffSeconds: 5 # transport backoff bounds
maxBackoffSeconds: 120
maxReplyChars: 3800 # outgoing reply capNotes & limits
- One iLink connection per WeChat account globally — don't run another
WeChat gateway (OpenClaw, Hermes, hermesclaw…) on the same account while this bridge runs, or tokens will conflict (403s / dropped messages).
- Text messages only in v0.1 (the protocol lib also supports images/voice/
files — media handling is a natural next step).
- Self-sent messages don't reach the bot channel; test from another account.
- Reply latency = model turn time (tens of seconds typical); the iLink side
has no typing indicator wired up in v0.1.
License: MIT-style, do whatever you like; no warranty.