fix(feishu): remove faulty table→text fallback in outbound payload - #33641
Open
wowpigpan wants to merge 1 commit into
Open
fix(feishu): remove faulty table→text fallback in outbound payload#33641wowpigpan wants to merge 1 commit into
wowpigpan wants to merge 1 commit into
Conversation
The _build_outbound_payload function was downgrading messages containing markdown tables from post type (rich rendering) to text type (raw markdown). This caused ALL markdown formatting (headings, bold, code blocks, lists) in the entire message to appear as raw text when a table was present. Feishu's post 'md' element renders tables correctly on current client versions, making the fallback unnecessary and harmful. Tested on Feishu 7.x client — all markdown elements including tables render correctly in post type.
Collaborator
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the focused Feishu report. The force-text behavior is still present, but this patch needs a small re-scope before it can affect current main.
Problems
- Current main moved the active adapter from
gateway/platforms/feishu.pytoplugins/platforms/feishu/adapter.pyin560010547; the PR changes only the removed path. - Removing the early return alone does not make a bare table a
post:_MARKDOWN_HINT_REatplugins/platforms/feishu/adapter.py:154-157has no table alternative, so the finaltextreturn at:4533-4534still applies. - The patch has no regression test for table-only routing.
Suggested changes
- Apply the change to
plugins/platforms/feishu/adapter.pyand route table-regex matches through_build_markdown_post_payload()alongside markdown hints. - Add
tests/gateway/test_feishu.pycoverage for bare-table and mixed markdown-plus-tablepostrouting, with a plain-text control.
This is an automated hermes-sweeper review.
| # Feishu post-type 'md' elements do not render tables, so we force text mode. | ||
| # No longer used in _build_outbound_payload (post md tags render tables fine), | ||
| # but kept for potential future use. | ||
| _MARKDOWN_TABLE_RE = re.compile(r"^\|.*\|\n\|[-|: ]+\|", re.MULTILINE) |
Contributor
There was a problem hiding this comment.
This file is no longer the active adapter on current main (560010547 moved it to plugins/platforms/feishu/adapter.py). Also, removing the force-text branch without adding table syntax to the post-routing predicate leaves a bare table at the final text return; salvage this by routing _MARKDOWN_TABLE_RE matches to post in the plugin and add a bare-table regression test.
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
The
_build_outbound_payloadfunction was downgrading messages containing markdown tables fromposttype (rich rendering) totexttype (raw text). This caused all markdown formatting to appear as raw source when a table was present.Root Cause
The function checked for markdown tables first and forced the entire message to
textmsg_type. Feishu clients now render tables correctly inposttype via themdelement.Fix
Removed the table-detection fallback. Messages with markdown (including tables) now use
posttype. Plain text usestexttype.Test Plan