Skip to content

fix(gateway/feishu): migrate markdown rendering to CardKit 2.0 interactive cards#23494

Open
hyhy111 wants to merge 1 commit into
NousResearch:mainfrom
hyhy111:fix-feishu-cardkit2-markdown
Open

fix(gateway/feishu): migrate markdown rendering to CardKit 2.0 interactive cards#23494
hyhy111 wants to merge 1 commit into
NousResearch:mainfrom
hyhy111:fix-feishu-cardkit2-markdown

Conversation

@hyhy111

@hyhy111 hyhy111 commented May 11, 2026

Copy link
Copy Markdown

Problem

Feishu recently stopped rendering markdown markup inside the legacy post message type's md tag. This caused all markdown content (tables, bold, code blocks, etc.) to be displayed as raw source text unless the user tapped to open a detail view.

Solution

Replace the post path with CardKit 2.0's interactive message type using the tag: "markdown" component, which natively supports standard GFM syntax and renders correctly on both desktop and mobile Feishu clients.

Changes

  • _build_outbound_payload: route markdown content to _build_cardkit_markdown_payload returning interactive type
  • _build_cardkit_markdown_payload: split content into sections and build a CardKit 2.0 card with markdown elements (max 10)
  • Update fallback logic in _feishu_send_with_retry to handle both post and interactive failures, falling back to plain text

Fixes

  • Markdown tables appearing blank
  • General markdown not rendering in Feishu

Related: PR #7085 (closed, unmerged)

Testing

  • Verified markdown tables, bold, code blocks, and lists render correctly on Feishu desktop and mobile
  • Verified fallback to plain text when interactive payload is rejected by API

…ctive cards

Feishu recently stopped rendering markdown markup inside the legacy
post message type's md tag.  This caused all markdown content
(tables, bold, code blocks, etc.) to be displayed as raw source text
unless the user tapped to open a detail view.

This commit replaces the post path with CardKit 2.0's
interactive message type using the tag: markdown component,
which natively supports standard GFM syntax and renders correctly on
both desktop and mobile Feishu clients.

Changes:
- _build_outbound_payload: route markdown content to
  _build_cardkit_markdown_payload returning interactive type
- _build_cardkit_markdown_payload: split content into sections and
  build a CardKit 2.0 card with markdown elements (max 10)
- Update fallback logic in _feishu_send_with_retry to handle both
  post and interactive failures, falling back to plain text

Fixes: markdown tables appearing blank; general markdown not rendering.
Related: PR NousResearch#7085 (closed, unmerged).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants