Skip to content

Lark/Feishu WebSocket connection fails with 404, then segfaults #379

@Aisht669

Description

@Aisht669

Description

Summary
When configuring the Lark channel with receive_mode: "websocket" and use_feishu: true, nullclaw crashes immediately after "lark gateway
started" message. Investigation shows the WebSocket endpoint /ws/v2 returns 404 Not Found.

Steps to Reproduce

   1. Configure ~/.nullclaw/config.json:
   {
     "channels": {
       "lark": {
         "accounts": {
           "main": {
             "app_id": "cli_xxx",
             "app_secret": "xxx",
             "use_feishu": true,
             "receive_mode": "websocket",
             "allow_from": ["*"]
           }
         }
       }
     }
   }
  1. Enable "Use long connection to receive events" (使用长连接接收事件) in Feishu Open Platform
  2. Add event subscription: im.message.receive_v1
  3. Run nullclaw gateway

Actual Behavior

nullclaw gateway runtime started
Gateway: http://127.0.0.1:3000
Components: 3 active
info(channel_manager): lark gateway started
timeout: the monitored command dumped core

Additional Investigation

Testing the WebSocket endpoint directly with Python:

ws_url = f"wss://open.feishu.cn/ws/v2?app_id={app_id}&access_token={app_access_token}"

Returns: Handshake status 404 Not Found

The API credentials are valid - tenant_access_token and app_access_token can be obtained successfully via HTTP API.

Expected Behavior

WebSocket should connect successfully to Feishu's long connection endpoint and receive events.

Environment

  • nullclaw version: v2026.3.7
  • OS: Linux x86_64 (Incus container)
  • Feishu region: China (open.feishu.cn)
  • Long connection: Enabled in Feishu Open Platform

Possible Cause

The WebSocket endpoint /ws/v2 used in src/channels/lark.zig may be outdated or incorrect. The official Feishu SDK (@larksuiteoapi/node-sdk)
uses internal WebSocket handling that works correctly, suggesting the endpoint or authentication method may have changed.

Reference: PR #300 mentions "known legacy segfault still appears" in the validation section.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions