Skip to content

feat: add WeChat channel plugin (ilink)#6

Open
videGavin wants to merge 1 commit intofastclaw-ai:mainfrom
videGavin:feat/weixin-channel-plugin
Open

feat: add WeChat channel plugin (ilink)#6
videGavin wants to merge 1 commit intofastclaw-ai:mainfrom
videGavin:feat/weixin-channel-plugin

Conversation

@videGavin
Copy link

Summary

  • Add a WeChat channel plugin that bridges messages via the ilink bot API
  • Supports text messaging, voice transcription, quoted replies, and multi-account
  • Session persistence across gateway restarts (sync buf + context tokens)
  • Exponential backoff and session expiry handling
  • Zero dependencies — uses Node.js built-in fetch and crypto

Plugin Structure

plugins/weixin/
├── plugin.json    # Plugin manifest (type: channel)
├── plugin.mjs     # JSON-RPC subprocess plugin (Node.js)
└── README.md      # Documentation

How It Works

  1. Plugin starts as a subprocess, communicates via JSON-RPC over stdin/stdout
  2. On initialize: loads WeChat accounts, starts long-poll monitors per account
  3. Incoming messages → message.inbound notification → FastClaw routes to agent
  4. Agent reply → FastClaw sends channel.send → plugin forwards via ilink sendMessage

Test Plan

  • Plugin discovered and started by FastClaw gateway
  • Multi-account monitoring (2 accounts)
  • Inbound message received and routed to agent
  • Agent reply sent back to WeChat user
  • Session expiry detection and pause
  • New account auto-detection
  • Voice message transcription
  • Media message handling

🤖 Generated with Claude Code

Add a channel plugin that bridges WeChat messages via the ilink bot API.

- Long-poll messaging via ilink getUpdates
- Text send/receive with markdown stripping
- Voice-to-text transcription support
- Quoted reply context preservation
- Multi-account with auto-detection of new accounts
- Session persistence (sync buf + context tokens) across restarts
- Exponential backoff and session expiry handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@idoubi
Copy link
Contributor

idoubi commented Mar 27, 2026

Thank you for your contribution.

Could you submit this plugin as a standalone repository? Something like this:
https://github.com/cornking2020/fastclaw-mattermost-plugin

Maybe you could name it: fastclaw-plugin-weixin.

@videGavin
Copy link
Author

videGavin commented Mar 27, 2026 via email

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.

2 participants