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):
- Buffer rapid successive text messages from the same user/chat
- Concatenate chunks before dispatching
- Use adaptive delay: if the latest chunk is near the platform's message limit, wait longer (continuation is almost certain)
- 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
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
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):
The pattern is ~20 lines per adapter. Discord and Feishu are the highest priority.
Progress
Ref
gateway/platforms/telegram.py:2153-2197— batching code to port to remaining platforms