fix(feishu): markdown table auto-wrap + card content, text parsing, reply truncation, parent_id fallback - #19312
Closed
resurgence wants to merge 2 commits into
Closed
fix(feishu): markdown table auto-wrap + card content, text parsing, reply truncation, parent_id fallback#19312resurgence wants to merge 2 commits into
resurgence wants to merge 2 commits into
Conversation
added 2 commits
April 30, 2026 10:00
…arent_id REST fallback
Cherry-pick from origin/fix/feishu-card-content-and-text-parsing onto upstream/main:
- card_msg_content_type='user_card_content' for interactive message detail API
- Add 'text' tag to _collect_text_segments for card text extraction
- Increase action lines limit from 12 to 100
- Raise reply_to_text limit from 500 to 3000 chars with Chinese truncation marker
- session_id injection via event._session_id
- _fetch_message_detail REST fallback for missing parent_id
- History-aware reply marker
Also applied async build_channel_directory from stash@{0}:
- startup: await build_channel_directory
- reconnect: await build_channel_directory
- cron ticker: run_coroutine_threadsafe with 10s timeout
…s (Patch 8) Feishu text message type strips markdown table syntax entirely, and the post type md tag doesn't support native tables either. Pre-process outbound content with _wrap_markdown_tables() to detect table blocks via _MARKDOWN_TABLE_BLOCK_RE and wrap them in code fences. The code fences trigger _MARKDOWN_HINT_RE which routes the message through the post channel where code blocks render correctly. Fixes: tables in replies disappearing on Feishu
Collaborator
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
8 Feishu patches for Hermes gateway, combining existing fixes with a new markdown table rendering fix.
Patches included:
New in this update (Patch 8):
Feishu text message type strips markdown table syntax entirely, and the post type md tag does not support native tables either. The
_wrap_markdown_tables()method detects table blocks via_MARKDOWN_TABLE_BLOCK_REand wraps them in code fences. The code fences trigger_MARKDOWN_HINT_RE, routing the message through the post channel where code blocks render correctly.Files changed:
gateway/platforms/feishu.pygateway/run.pyTesting:
Closes: Previous closed PR #17709