feat(gateway/feishu): render markdown tables via interactive card - #35906
Open
eaglewa wants to merge 1 commit into
Open
feat(gateway/feishu): render markdown tables via interactive card#35906eaglewa wants to merge 1 commit into
eaglewa wants to merge 1 commit into
Conversation
Feishu 'post' / 'lark_md' elements cannot render GFM markdown tables — the message arrives blank on the client — so `_build_outbound_payload` previously downgraded any table content to plain text, losing the table. The interactive-card 'markdown' component (card schema 2.0) does render tables, so route table content to a card instead. Non-table content is unchanged (markdown -> post, plain -> text). `send()` falls back to plain text if the card payload is rejected, so a malformed card never drops the message.
Collaborator
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the focused table-rendering contribution. The underlying issue remains: current main routes detected tables to plain text at plugins/platforms/feishu/adapter.py:4524-4533.
Problems
- The patch changes
gateway/platforms/feishu.py, but5600105478ffde29d7566b45421b100eaa29c4efmoved the active adapter toplugins/platforms/feishu/adapter.py; this needs a port rather than a direct merge. - The new interactive exception fallback does not cover unsuccessful API responses: the adjacent response fallback remains restricted to
msg_type == "post"atplugins/platforms/feishu/adapter.py:1924-1936. edit_message()also consumes_build_outbound_payload()(plugins/platforms/feishu/adapter.py:1958), but its fallback is post-only at:1963-1971.
Suggested changes
- Port the implementation and tests to the bundled plugin path.
- Cover interactive send exceptions, unsuccessful responses, and edit rejection with plain-text fallback tests.
Automated hermes-sweeper review.
| ) | ||
| except Exception as exc: | ||
| if msg_type != "post" or not _POST_CONTENT_INVALID_RE.search(str(exc)): | ||
| if msg_type == "interactive": |
Contributor
There was a problem hiding this comment.
This handles exceptions, but the response-based fallback immediately below remains limited to msg_type == "post". If Feishu rejects an interactive card by returning an unsuccessful response rather than raising, send() still returns failure; extend that guard and add coverage for this response path.
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
Feishu
post/lark_mdelements cannot render GFM markdown tables — themessage arrives blank on the client.
_build_outbound_payloadthereforedowngraded any table content to plain text, losing the table formatting.
The interactive-card
markdowncomponent (card schema 2.0) does rendertables, so this routes table content to an interactive card instead. Non-table
content is unchanged:
post(renders fine today)textsend()falls back to plain text if a card payload is rejected by the API, soa malformed card can never drop the message.
Tests
tests/gateway/test_feishu_card_rendering.py:post(unchanged)text(unchanged)