hermes - ✅(Solved) Fix [Feature Request] Feishu: Auto-split long messages like WeChat adapter [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#19676Fetched 2026-05-05 06:05:36
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×1

The WeChat (weixin) platform adapter automatically splits long agent messages into multiple shorter messages before delivery, using functions like _split_delivery_units_for_weixin and _pack_markdown_blocks_for_weixin in gateway/platforms/weixin*.py.

However, the Feishu adapter (gateway/platforms/feishu*.py) does not have this feature for regular chat messages — it only chunks text for document comments (_chunk_text in feishu_comment.py).

Root Cause

The WeChat (weixin) platform adapter automatically splits long agent messages into multiple shorter messages before delivery, using functions like _split_delivery_units_for_weixin and _pack_markdown_blocks_for_weixin in gateway/platforms/weixin*.py.

However, the Feishu adapter (gateway/platforms/feishu*.py) does not have this feature for regular chat messages — it only chunks text for document comments (_chunk_text in feishu_comment.py).

PR fix notes

PR #20049: fix(feishu): split long outbound messages

Description (problem / solution / changelog)

Fixes #19676\n\n## Summary\n- add Feishu block-aware outbound chunking with a chat-sized target while preserving the existing max message limit\n- keep fenced code blocks intact when possible and continue using the existing text/post payload and fallback path per chunk\n- add a Feishu send-pipeline regression test for multiple markdown post messages\n\n## Verification\n- scripts/run_tests.sh tests/gateway/test_feishu.py -k 'splits_long_markdown'\n- scripts/run_tests.sh tests/gateway/test_feishu.py\n- git diff --check\n\nNote: .venv/bin/python -m ruff check gateway/platforms/feishu.py tests/gateway/test_feishu.py still reports pre-existing lint issues in these files, including module-level import ordering and existing unused/import annotation warnings unrelated to this patch.

Changed files

  • gateway/platforms/feishu.py (modified, +80/-1)
  • tests/gateway/test_feishu.py (modified, +43/-0)
RAW_BUFFERClick to expand / collapse

Description

The WeChat (weixin) platform adapter automatically splits long agent messages into multiple shorter messages before delivery, using functions like _split_delivery_units_for_weixin and _pack_markdown_blocks_for_weixin in gateway/platforms/weixin*.py.

However, the Feishu adapter (gateway/platforms/feishu*.py) does not have this feature for regular chat messages — it only chunks text for document comments (_chunk_text in feishu_comment.py).

Problem

When the agent generates a long response, Feishu delivers it as one giant message block, which:

  • Feels unnatural in chat (unlike real human conversation)
  • Is harder to read on mobile
  • Inconsistent with the WeChat experience on the same agent

Proposed Solution

Add auto-splitting logic to the Feishu platform adapter, similar to what WeChat does:

  • Split long messages at natural boundaries (paragraphs, markdown blocks)
  • Respect Feishu's message length limits
  • Preserve formatting across split messages

Context

This came up when a user noticed their WeChat messages were nicely split into short conversational chunks, but the same agent on Feishu sent one wall of text.

extent analysis

TL;DR

Implement auto-splitting logic in the Feishu platform adapter to split long messages into shorter ones at natural boundaries.

Guidance

  • Review the _split_delivery_units_for_weixin and _pack_markdown_blocks_for_weixin functions in gateway/platforms/weixin*.py to understand the existing splitting logic for WeChat.
  • Adapt this logic for Feishu, considering its message length limits and formatting requirements.
  • Integrate the new splitting logic into the Feishu adapter (gateway/platforms/feishu*.py) to ensure consistent message formatting across platforms.
  • Test the updated Feishu adapter with various message lengths and formats to verify the splitting logic works as expected.

Example

No code example is provided as the issue does not contain specific implementation details.

Notes

The proposed solution requires careful consideration of Feishu's specific requirements and limitations to ensure seamless integration and consistent user experience.

Recommendation

Apply workaround by implementing the proposed auto-splitting logic in the Feishu platform adapter, as it addresses the inconsistency in message formatting between WeChat and Feishu.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Feature Request] Feishu: Auto-split long messages like WeChat adapter [1 pull requests, 1 participants]