Skip to content

feat(weixin): add trusted iLink channel#2240

Merged
esengine merged 2 commits into
esengine:mainfrom
PorunC:feature/weixin-channel
May 29, 2026
Merged

feat(weixin): add trusted iLink channel#2240
esengine merged 2 commits into
esengine:mainfrom
PorunC:feature/weixin-channel

Conversation

@PorunC

@PorunC PorunC commented May 29, 2026

Copy link
Copy Markdown
Contributor

What

Adds a scoped Weixin remote channel backed by Tencent iLink/OpenClaw bot APIs. /weixin connect now runs QR login, persists the sensitive bot token in the Reasonix account store instead of the main config, and wires trusted Weixin messages into the existing slash/confirmation/final-reply path. Manual token setup remains available as /weixin connect manual [token accountId [baseUrl]].

Why

Weixin support has come up in multiple places: the broader chat bridge RFC in #410 (comment), the focused Weixin issue in #2237 (comment), and the discussion request in #22 (comment).

This implementation deliberately uses the iLink protocol that Weixin exposes for OpenClaw-style bot access instead of browser automation, unofficial web hooks, or personal-client scraping. That keeps the integration on the intended bot API path and should avoid the account-ban risk associated with automating the normal WeChat client login surface.

How to verify

  • npm run verify
  • /weixin connect and scan the iLink QR code from WeChat
  • Send a trusted Weixin message and confirm it reaches the normal Reasonix turn queue
  • /weixin status
  • /weixin disconnect

Checklist

  • npm run verify passes locally (lint + typecheck + tests + comment-policy gate)
  • No Co-Authored-By: Claude trailer in commits
  • Comments follow CONTRIBUTING.md (no module-essay headers, no incident history)
  • No edits to CHANGELOG.md — release notes are maintainer-written at release time

Comment thread src/weixin/bot.ts Fixed
Comment thread src/weixin/bot.ts
try {
const res = await fetch(`${this.baseUrl}/${endpoint}`, {
method: "POST",
headers: headers(this.token),

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the security model — it mirrors the proven Telegram (#2168/#2222) and Feishu (#2185) channels, and the essentials check out:

  • Fail-closed access: decideWeixinAccess gates on owner/allowlist/runtime and ends in { accept: false, reason: "unauthorized" } — an unconfigured channel rejects everyone.
  • Authenticated ingress, no forgeable webhook: /weixin connect does QR login and the bot connects outbound to the iLink/OpenClaw API with the token (no createServer/inbound endpoint), so there's no public webhook to spoof — the authenticated connection is the trust boundary.
  • Dispatch gated on acceptRemoteInput before a message reaches the agent (9 call sites).
  • Token isolation: the sensitive bot token is persisted in the account store, not the main config — good call.

CI green, follows the established channel shape, by the same author as the Telegram work. I didn't deep-audit the iLink/OpenClaw API client itself, but the channel's security contract is sound, which is what matters for a remote tool-driving surface. Merging.

@esengine esengine merged commit f3082b9 into esengine:main May 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants