Connect Crew to personal WeChat (微信) through Tencent's iLink bot API. Sign-in is a QR scan from the dashboard; messages arrive over HTTP long-poll, so no public endpoint, webhook, or tunnel is required.
Prefer WeCom for anything business-critical.
The bot credential is written server-side (into the credential store, never returned to the browser). Only the non-secret account ID and connection status are exposed to the dashboard.
The QR flow requires the dashboard UI — there's no CLI-only path for the initial sign-in. After connecting via the dashboard, manage settings in config.json:
{ "weixin": { "enabled": true, "dm_policy": "allowlist", "allowed_user_ids": ["user-id-from-log"] } }
Then: kirocrew restart
Who can message the bot maps to weixin.dm_policy:
| Value | Behavior |
|---|---|
allowlist (default) | Only user IDs in weixin.allowed_user_ids |
open | Anyone who messages the bot |
disabled | All messages ignored |
The default is allowlist with an empty list, which authorizes nobody — a freshly connected bot ignores every DM until you add an ID. To collect a user ID, have the person DM the bot once and read the ID from the gateway log.
| Command | Effect |
|---|---|
/new (or 新对话, 清空) | Start a fresh session |
/compact | Compact session context in place |
Context is managed automatically: at soft_threshold_pct (80%) the bot suggests /compact or /new; at hard_threshold_pct (95%) it compacts on its own.
interactive mode, tools needing approval are denied by default. Use auto or trust mode, or approve from the dashboard.Set under weixin in config.json (or via the Settings panel):
| Key | Default | Purpose |
|---|---|---|
weixin.enabled | false | Enable the channel |
weixin.account_id | — | iLink bot account ID (from QR login) |
weixin.base_url | https://ilinkai.weixin.qq.com | iLink API base URL |
weixin.dm_policy | allowlist | allowlist / open / disabled |
weixin.allowed_user_ids | [] | Permitted user IDs when allowlist |
weixin.soft_threshold_pct | 80 | Suggest compaction past this usage |
weixin.hard_threshold_pct | 95 | Force compaction past this |
The credential is read from the WEIXIN_TOKEN credential (env / .env / credential store).
| Problem | Fix |
|---|---|
| Status stuck on "Signed in — restart to connect" | Restart the gateway; credentials are read once at boot |
errcode -14 in the log | Session expired — re-run the QR sign-in |
errcode -2 | iLink rate limit; the poller backs off automatically |
| Bot ignores DMs | Check dm_policy — under allowlist the sender must be listed |
| Group messages ignored | Expected: iLink bot identities do not receive group events |
| Images / voice / files ignored | Expected: text only for now |
Startup error about aiohttp | Install the messaging extra |
WeChat (Weixin)