Skip to content

fix(send_message): 钉钉 Markdown + 飞书表格渲染 + QQ Markdown 支持 / DingTalk markdown + Feishu tables + QQBot markdown - #50500

Closed
WenhuaXia wants to merge 5 commits into
NousResearch:mainfrom
WenhuaXia:fix/messaging-markdown-tables
Closed

WenhuaXia wants to merge 5 commits into
NousResearch:mainfrom
WenhuaXia:fix/messaging-markdown-tables

Conversation

@WenhuaXia

Copy link
Copy Markdown

中文

问题:standalone 发送路径下,钉钉走纯文本、飞书检测到表格强制 text 模式、QQ 用 msg_type=0 纯文本,导致 markdown 表格在各平台无法正常渲染。

改动

  • 钉钉:standalone delivery 从 text 改为 markdown,被拒绝时 fallback 纯文本,与 live adapter 对齐
  • 飞书:移除 强制 text 模式 workaround,表格走 markdown post 管线原生渲染
  • QQ Bot:standalone 发送从 (text) 改为 (markdown),启用 rich rendering

English

Problem: The standalone send path sends DingTalk as plain text, Feishu forces text mode for tables, and QQBot uses msg_type=0 (plain text), causing markdown tables to render as literal characters.

Changes:

  • DingTalk: standalone delivery from text to markdown with plain-text fallback, aligned with live adapter
  • Feishu: remove text-mode workaround, tables now render natively via markdown post pipeline
  • QQBot: standalone send from (text) to (markdown), enabling rich rendering

- 钉钉: send_message_tool standalone delivery 从 text 改为 markdown,
  被拒绝时 fallback 到纯文本, 与 live adapter 对齐
- 飞书: 移除 _MARKDOWN_TABLE_RE workaround, 表格走 post markdown 管道
  (飞书已原生支持表格). 修复 fallback 路径保留原始 markdown
  而非 _strip_markdown_to_plain_text

Refs: NousResearch#37345 (dingtalk PR), NousResearch#27922 (feishu PR)
The previous (\|.*\|) pattern was too broad - it would match any line
containing pipes, causing false positives. The correct pattern from PR
NousResearch#27922 is (^\s*\|) which only matches lines starting with | (table cells).

Refs: NousResearch#27922
The patch tool had introduced double-escaped backslashes (\\ instead of \),
causing FutureWarning on Python 3.12+. Corrected to single backslashes
matching the original file encoding.

Refs: NousResearch#39510
- gateway/platforms/__init__.py: 添加 FeishuAdapter/WeComAdapter lazy import
- tools/send_message_tool.py: 3处 from gateway.platforms.feishu/wecom
  改为 from plugins.platforms.feishu/wecom.adapter

Refs: NousResearch#41112
QQ Bot standalone path now uses msg_type=2 (markdown) instead of
msg_type=0 (plain text), enabling rich rendering of markdown tables.

Refs: NousResearch#39510
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter platform/dingtalk DingTalk adapter platform/qqbot QQ Bot adapter P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 22, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

Duplicate of #39510 — same author, identical file set (gateway/platforms/__init__.py, plugins/platforms/feishu/adapter.py, tools/send_message_tool.py), same standalone-send markdown switch for DingTalk + Feishu tables. This PR adds QQBot to the same send_message_tool.py site (superset at the same code site, same mechanism) → duplicate of the earlier-open #39510. Related: #37345 (closed predecessor).

@WenhuaXia

Copy link
Copy Markdown
Author

Superseded by update to #39510

@WenhuaXia WenhuaXia closed this Jun 22, 2026
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 duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/dingtalk DingTalk adapter platform/feishu Feishu / Lark adapter platform/qqbot QQ Bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants