Skip to content

[Gateway] Split inbound messages lost on Discord, Feishu, Matrix, WeCom — no text batching #6892

@SHL0MS

Description

@SHL0MS

Problem

When a user pastes a long message, the messaging client splits it at the platform's character limit. If the gateway doesn't batch these chunks, only the first part is processed and the rest is silently lost or processed as a separate message after the agent has already responded.

Affected platforms

Platform Message limit Has inbound batching? Status
Discord 2000 chars No Worst — low limit, no batching at all
Feishu ~4096 chars Yes (0.6s static delay) Has batching but no adaptive delay for splits
Matrix 4000 chars No No batching
WeCom 4000 chars No No batching
Telegram 4096 chars Yes (adaptive) Fixed in PR #6891
Signal 8000 chars No Lower risk due to higher limit
WhatsApp 65536 chars No Low risk
Slack 39000 chars No Low risk
DingTalk 20000 chars No Low risk

Impact

Discord is the most impacted — at 2000 chars, even a moderate code block or prompt gets split. Users pasting code, error logs, or long instructions will routinely lose the second half.

Suggested fix

Port the adaptive batching pattern from the Telegram adapter (PR #6891):

  1. Buffer rapid successive text messages from the same user/chat
  2. Concatenate chunks before dispatching
  3. Use adaptive delay: if the latest chunk is near the platform's message limit, wait longer (continuation is almost certain)
  4. Flush when a short chunk arrives (end of the message)

The pattern is ~20 lines per adapter. Discord and Feishu are the highest priority.

Progress

Platform Status PR
Telegram Fixed #6891 — adaptive batch delay (21 lines)
Discord Fixed #6894 — text batching from scratch (66 lines)
Feishu Has batching, needs adaptive delay
Matrix No batching
WeCom No batching

Ref

  • gateway/platforms/telegram.py:2153-2197 — batching code to port to remaining platforms

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/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