Skip to content

WeChat Work Robot API mode with WebSocket for proactive messaging #40

Description

@longzhi

Background

WeCom (企业微信) version 5.0.7 introduced a new Robot API mode with WebSocket long connections that supports:

  • WebSocket-based persistent connection (no public domain/IP required)
  • Proactive message sending (the current AI Bot mode cannot do this)
  • Document/spreadsheet editing authorization for bot members
  • Event reminders

Current State

The existing wecom.rs channel adapter uses the AI Bot mode (aibot_subscribe / aibot_respond_msg / aibot_msg_callback), which is a request-response protocol. It cannot send proactive messages, which means:

  • Scheduled task delivery is not supported
  • Approval UI cannot be pushed to users (currently warn-only with 60s timeout fallback)
  • Announcements cannot be delivered proactively

Proposal

Implement a new WeCom channel adapter (or extend the existing one) using the Robot API mode WebSocket protocol. This would enable:

  1. Approval UI — push interactive approval requests (text-based /approve commands) to the conversation when the agent needs filesystem access
  2. Scheduled task delivery — deliver scheduled task results proactively
  3. Announcement delivery — support DeliverAnnounce bus events

References

  • WeCom 5.0.7 release notes (2026-03-14)
  • Current implementation: crates/clawhive-channels/src/wecom.rs
  • Approval pattern reference: crates/clawhive-channels/src/dingtalk.rs (similar WebSocket + proactive send)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: mediumImportant but not urgent, schedule itenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions