Skip to content

feat(wechatpad): support AddMsgs batching, deduplication, wrapped @ mentions, and optional auto-accept friend - #3003

Open
a251231 wants to merge 1 commit into
langbot-app:masterfrom
a251231:feat/wechatpad-enhancements
Open

a251231 wants to merge 1 commit into
langbot-app:masterfrom
a251231:feat/wechatpad-enhancements

Conversation

@a251231

@a251231 a251231 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

概述 / Overview

增强 WeChatPad 平台适配器的稳定性与功能:

  • 批量同步信封 (AddMsgs) 调度:WebSocket 收到包含 AddMsgs 数组的同步信封时,逐条调度到主事件循环并复用有界回调与停止清理机制。
  • 消息去重与入口保护 (wechatpad_message_guard.py):新增 WeChatPadMessageDeduplicator,基于消息 ID / 复合指纹对重复推送进行 TTL 去重,并忽略群聊历史图片占位重放。
  • 嵌套 <msgsource> @ 提及解析:兼容外层 XML 包裹的 <msgsource><atuserlist>...</atuserlist></msgsource>,确保群聊 @ 提及正常触发。
  • 可选自动通过好友申请 (auto_accept_friend):默认关闭(false),开启后支持解析 msg_type == 37 好友申请 XML,通过 AgreeAdd 接口(含群聊来源 chatroom_user_name 上下文)自动接受并校验返回码。

检查清单 / Checklist

PR 作者完成 / For PR author

  • 阅读仓库贡献指引了吗?
  • 我已签署或将在机器人提示后签署 CLA。
  • 我确定已自行测试所作的更改,确保功能符合预期。

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ 平台适配器变更提示 / Platform Adapter Change Notice

本 PR 修改了平台适配器相关文件。平台适配器依赖真实的 IM 平台行为,单元测试无法完全覆盖,合并前需要维护者在真实平台上进行实际检查(收发消息、事件回调、媒体消息等关键链路)。

This PR modifies platform adapter files. Platform adapters depend on real IM platform behavior that unit tests cannot fully cover, so a maintainer must verify the change against the real platform before merging (sending/receiving messages, event callbacks, media messages and other critical paths).

被修改的平台适配器文件 / Changed platform adapter files (6):

  • src/langbot/libs/wechatpad_api/api/friend.py (modified, +16/-0)
  • src/langbot/libs/wechatpad_api/client.py (modified, +9/-0)
  • src/langbot/pkg/platform/sources/wechatpad.py (modified, +46/-8)
  • src/langbot/pkg/platform/sources/wechatpad.yaml (modified, +8/-0)
  • src/langbot/pkg/platform/sources/wechatpad_friend_request.py (added, +48/-0)
  • src/langbot/pkg/platform/sources/wechatpad_message_guard.py (added, +51/-0)

最近更新于提交 / Last updated for commit c05ff4e

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. ✅ 所有贡献者均已签署 CLA。
Posted by the CLA Assistant Lite bot.

@a251231

a251231 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

This branch has not been deployed

No deployments
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