Skip to content

[Bug]: Feishu per-chat queue can hang indefinitely, leaving later P2P messages queued #70133

@loyur

Description

@loyur

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

In the Feishu channel, a single p2p message can hang for minutes without dispatch complete, and later messages in the same chat remain queued behind it until the stuck task eventually finishes or the gateway is restarted.

Steps to reproduce

  1. Start OpenClaw 2026.4.20 with Feishu enabled in websocket mode.
  2. Send a p2p message to the Feishu bot.
  3. Observe a log line like:
    feishu[default]: dispatching to agent (session=agent:baiqi:feishu:direct:...)
  4. Before that message produces dispatch complete, send another p2p message in the same chat.
  5. Observe the later message is logged as:
    message ... in chat ... — queued
  6. Observe no reply for the later message until the earlier stuck task completes, or recover by restarting the gateway.

Expected behavior

A stuck Feishu task should not block the same chat indefinitely. The queue should eventually release or time out so later messages can continue processing.

Actual behavior

Observed twice on the same system:

  • At 2026-04-22 18:47:51 +08:00, a p2p message started dispatching to agent:baiqi:feishu:direct:...
  • At 18:51:07 and 18:53:01, later messages in the same chat were logged as queued
  • dispatch complete for the original stuck task did not appear until 18:55:23
  • After gateway restart, the same pattern recurred:
    • 18:57:32 dispatch started
    • 18:59:46 a later message in the same chat was already queued
    • no dispatch complete had appeared for the earlier task by then

OpenClaw version

OpenClaw 2026.4.20 (115f05d)

Operating system

macOS 26.4.1 (Build 25E253)

Install method

NOT_ENOUGH_INFO

Model

google-gemini-cli / gemini-3-flash-preview

Provider / routing chain

openclaw -> google-gemini-cli

Additional provider/model setup details

Observed on the Feishu channel with:

  • connectionMode: websocket
  • streaming: true
  • replyMode: auto

The stuck session key in the observed runs was agent:baiqi:feishu:direct:....

Logs, screenshots, and evidence

2026-04-22T18:47:51.589+08:00 [feishu] feishu[default]: message om_x100b51be3bbe6c98b321ee723f2033a in chat oc_e0997af681c870903a32dadb36422fa0 — immediate
2026-04-22T18:47:51.597+08:00 [feishu] feishu[default]: dispatching to agent (session=agent:baiqi:feishu:direct:ou_8968f16286b54723a71566fe6fc701a5)
2026-04-22T18:51:07.893+08:00 [feishu] feishu[default]: message om_x100b51becf7b90b4b368bed8b68ff02 in chat oc_e0997af681c870903a32dadb36422fa0 — queued
2026-04-22T18:53:01.431+08:00 [feishu] feishu[default]: message om_x100b51bec60368b8b2c4e01adba9bbb in chat oc_e0997af681c870903a32dadb36422fa0 — queued
2026-04-22T18:55:23.936+08:00 [feishu] feishu[default]: dispatch complete (queuedFinal=true, replies=1)

2026-04-22T18:57:31.924+08:00 [feishu] feishu[default]: message om_x100b51bed77564b4b3ce1f22ca0c845 in chat oc_e0997af681c870903a32dadb36422fa0 — immediate
2026-04-22T18:57:32.341+08:00 [feishu] feishu[default]: dispatching to agent (session=agent:baiqi:feishu:direct:ou_8968f16286b54723a71566fe6fc701a5)
2026-04-22T18:59:46.402+08:00 [feishu] feishu[default]: message om_x100b51beeced0134b4b217eaf4ecc30 in chat oc_e0997af681c870903a32dadb36422fa0 — queued

Local code inspection suggests the Feishu per-chat serial queue does not have a timeout/release guard:

  • extensions/openclaw-lark/src/channel/chat-queue.js
  • extensions/openclaw-lark/src/messaging/inbound/dispatch.js

Impact and severity

Affected: Feishu p2p chats on this installation
Severity: High (blocks replies in the affected chat)
Frequency: Observed 2 times in a row on 2026-04-22
Consequence: Later user messages in the same chat do not get processed until the stuck task finishes or the gateway is restarted

Additional information

This appears distinct from issue #58953. That issue reports replies=0 after gateway restart and recovery after a group-chat wake-up. This report is about one Feishu task occupying the per-chat queue for minutes, causing later messages in the same chat to remain queued.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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