Skip to content

feat: Add webhook mode for Lark international (no WebSocket support) #237

@Viviadx

Description

@Viviadx

Problem

Lark (international version at open.larksuite.com) does not provide WebSocket long connection for event subscriptions. Only domestic Feishu (open.feishu.cn) supports it. This makes the Feishu bridge unusable for all Lark international users.

Reference: m1heng/clawdbot-feishu#277

Proposed Solution

Add an alternative webhook mode to the Feishu adapter:

  • When bridge_feishu_mode = 'webhook', start a local HTTP server on 127.0.0.1 to receive Lark event callbacks
  • Include a lightweight Cloudflare Worker relay (free tier) + Cloudflare Tunnel for public HTTPS
  • 100% reuses existing message processing, auth, and send logic
  • Default mode remains websocket — zero impact on existing users

Implementation

PR incoming with:

  1. Webhook server in feishu-adapter.ts (Node.js http module, zero new dependencies)
  2. New settings (mode, port, verification token) in API route
  3. Updated UI with mode selector + webhook-specific setup guide
  4. Cloudflare Worker relay project in tools/lark-webhook-worker/
  5. Unit tests (7 test cases for event parsing and verification)
  6. Bilingual i18n (en + zh)

Architecture

Lark Message → Lark Platform (webhook) → Cloudflare Worker → Tunnel → localhost:9898 → CodePilot → Claude

Happy to discuss the approach!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions