Skip to content

feature/add weixin channel#250

Closed
duguwanglong wants to merge 3 commits into
mainfrom
feature/add-weixin-channel
Closed

feature/add weixin channel#250
duguwanglong wants to merge 3 commits into
mainfrom
feature/add-weixin-channel

Conversation

@duguwanglong
Copy link
Copy Markdown
Contributor

feat(channel/weixin): add groupPolicy config with default "all"

  • New groupPolicy field ("all" | "disabled" | "allowlist", default "all"):
    replaces the implicit always-mentioned=True workaround so group chat
    handling is explicit and configurable
  • New groupAllowFrom field: list of permitted group / room IDs for
    allowlist mode
  • _is_group_allowed() helper mirrors _is_dm_allowed() pattern
  • Fix msg.mentioned: was hardcoded True for every group message which
    conflated "all group messages" with "bot was @mentioned"; now False by
    default — pair with groupPolicy="all" (which bypasses the dispatcher's
    groupTrigger check at the channel level) for the intended behaviour
  • Frontend: WeixinPanel shows groupPolicy Select + conditional
    groupAllowFrom TagsInput; defaultWeixinConfig sets groupPolicy="all"
  • i18n: zh-CN / en-US entries for groupPolicy, groupPolicyAll/Allowlist/
    Disabled, groupAllowFrom, groupAllowFromHint, groupAllowFromPlaceholder

duguwanglong and others added 3 commits May 11, 2026 09:44
Backend
- New WeixinChannel plugin (flocks/channel/builtin/weixin/):
  - Long-poll getupdates drives inbound; AES-128-ECB CDN protocol for
    image / video / file / voice media download and upload
  - QR-code login flow (qr_login.py): start_qr_login / poll_qr_status
    with regional redirect support
  - Per-peer context_token continuity, content-addressed media cache,
    message deduplication with TTL, sync_buf cursor persistence
  - Default state directory: ~/.flocks/workspace/channels/weixin/
- API routes (server/routes/channel.py):
  - POST /api/channel/weixin/qr-login/start
  - GET  /api/channel/weixin/qr-login/status

Frontend
- WeixinPanel: QR modal with polling, auto-fills token + accountId +
  baseUrl on confirmed scan, auto-enables and restarts the channel
- zh-CN / en-US i18n entries for all WeChat-specific UI text
- WeChat channel icon (webui/public/channel-weixin.png)
- qrcode.react dependency for in-browser QR rendering

Fix: inbound media for non-Feishu channels
- _append_user_message (dispatcher.py) previously skipped media
  attachment for any channel other than Feishu; generalised to handle
  local file:// URIs (URL-decoded to support non-ASCII filenames)
  produced by channel plugins that pre-download inbound media
- Add InboundMessage.media_mime so downstream consumers receive the
  MIME type without re-guessing from the file extension

Co-authored-by: Cursor <cursoragent@cursor.com>
- New groupPolicy field ("all" | "disabled" | "allowlist", default "all"):
  replaces the implicit always-mentioned=True workaround so group chat
  handling is explicit and configurable
- New groupAllowFrom field: list of permitted group / room IDs for
  allowlist mode
- _is_group_allowed() helper mirrors _is_dm_allowed() pattern
- Fix msg.mentioned: was hardcoded True for every group message which
  conflated "all group messages" with "bot was @mentioned"; now False by
  default — pair with groupPolicy="all" (which bypasses the dispatcher's
  groupTrigger check at the channel level) for the intended behaviour
- Frontend: WeixinPanel shows groupPolicy Select + conditional
  groupAllowFrom TagsInput; defaultWeixinConfig sets groupPolicy="all"
- i18n: zh-CN / en-US entries for groupPolicy, groupPolicyAll/Allowlist/
  Disabled, groupAllowFrom, groupAllowFromHint, groupAllowFromPlaceholder

Co-authored-by: Cursor <cursoragent@cursor.com>
…inary group messages

QR-login creates an iLink bot identity (...@im.bot) which can only receive
messages via the iLink bot DM entry. Ordinary WeChat group messages are not
delivered by the iLink API regardless of groupPolicy — add a startup WARNING
log so users are not misled into debugging allowlists or restarts for a
capability the iLink bot account type does not support.

See also: NousResearch/hermes-agent#17094

Co-authored-by: Cursor <cursoragent@cursor.com>
@duguwanglong duguwanglong force-pushed the feature/add-weixin-channel branch from ccf26d7 to 12c8725 Compare May 11, 2026 01:45
@duguwanglong duguwanglong reopened this May 11, 2026
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.

1 participant