fix(feishu): render all markdown via Card 2.0 interactive cards - #46472
fix(feishu): render all markdown via Card 2.0 interactive cards#46472wait4xx wants to merge 1 commit into
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Good improvement to Feishu markdown rendering: adds Card 2.0 interactive card support with a 100KB size limit for graceful degradation to plain text. The Card 2.0 tag supports full CommonMark including GFM tables.
Looks Good
- Clean, well-scoped fix
- Good size-limit guard to prevent oversized payloads
- No security or stability concerns
Reviewed by Hermes Agent
Yes, I have consolidated all issues related to Feishu message rendering. Building upon the issue I previously opened, I have made further refinements and optimizations. I tested two table rendering approaches and ultimately retained the more concise solution. The Feishu message rendering issue remains unresolved on the latest |
|
Update — additional fixes layered on this branch (
Verified by sending real cards to Feishu (transparent 2× mermaid PNG, multi-table splitting). Co-authored-by: GLM 5.2 |
fbc266e to
0f840c0
Compare
0f840c0 to
e4784ac
Compare
|
Update — rebased onto latest
All 218 feishu tests pass. Ready for re-review after the force-push. Co-authored-by: GLM 5.2 |
|
Thanks for consolidating a real Feishu rendering defect: current main still explicitly routes Markdown tables to Problems
Suggested changes
Automated hermes-sweeper review. |
e4784ac to
c189e4b
Compare
|
Addressed the review feedback in Changes made
Verification
The resulting production change is limited to the Feishu adapter, its tests, and the Feishu user guide. Mermaid rendering can be considered separately later as an explicit opt-in feature with privacy documentation. Co-authored-by: gpt-5.6-sol <215057067+openai-codex[bot]@users.noreply.github.com> |
Replace the legacy post-type tag:md renderer with a Card 2.0 markdown element so tables, fenced code blocks, lists, headings, links, and plain text share one consistent outbound message type. - Route all outbound content to interactive cards by default so streaming send/edit paths keep the same msg_type. - Add platforms.feishu.extra.interactive_cards=false as a documented rollback to the legacy text/post routing. - Reuse the existing fence-aware message splitter and measure Feishu chunks in UTF-8 bytes, keeping multibyte content safely below the 30KB card limit. - Fall back to raw text for failed sends and retry rejected edits with a simplified interactive card. - Add focused coverage for Card 2.0 routing, GFM tables, multibyte fenced content, legacy rollback, send/edit fallback, and the pinned lark-oapi extra_ua_tags contract. - Update the Feishu user guide with the new rendering behavior and configuration. Keep this fix focused: Mermaid rendering, external renderers, custom card packing, prompt changes, and generic gateway language-tag hooks are intentionally excluded. Fixes NousResearch#25452 Supersedes NousResearch#25453 Co-authored-by: gpt-5.6-sol <215057067+openai-codex[bot]@users.noreply.github.com>
c189e4b to
f89941e
Compare
Correction: this is not being treated as a duplicate of #12114. After the rebase and scope reduction, it remains a related, salvageable Card 2.0 implementation; maintainers should choose among the open Feishu rendering approaches. |
|
Closing in favor of #68121 (merged 2026-07-20), which resolved #25452. #68121 took the minimal route — removed the If a real gap shows up in #68121's tenant-downgrade behavior (the Co-authored-by: GLM 5.2 |
Fixes #46470
Closes #25452
Closes #26841
Closes #29471
Supersedes #25453
Summary
Render all Feishu outbound text and Markdown through a Card 2.0
markdownelement, replacing the limited post-messagemdrenderer. This fixes GFM table rendering and keeps streaming sends and edits on one stableinteractivemessage type.Why Card 2.0 Markdown
Live Feishu card probes showed that Card 2.0 Markdown renders tables, fenced code blocks, lists, headings, blockquotes, and GFM alignment directly. The native table component rejects alignment and requires substantially more parsing code, so this PR keeps the content as Markdown and lets Feishu render it.
Changes
_build_markdown_card_payload()with one Card 2.0markdownelement.interactiveby default, including plain text, so streaming send/edit paths keep the samemsg_type.platforms.feishu.extra.interactive_cards: falseas a documented rollback to the legacy text/post routing.Review-driven scope reduction
mermaid.inkexternal fallback and all implicit content export.gateway/platforms/base.pyandgateway/run.pylanguage-tag changes.Mermaid remains a normal fenced code block. A future renderer, if pursued, should be a separate opt-in change with explicit privacy documentation.
Tests
scripts/run_tests.sh, covering Card 2.0 routing, tables, multibyte fenced content, legacy rollback, send/edit fallback, post helpers, and the pinnedlark-oapiextra_ua_tagscontract.upstream/main.Related work
mdrenderer rather than Card 2.0 MarkdownCo-authored-by: gpt-5.6-sol <215057067+openai-codex[bot]@users.noreply.github.com>