Skip to content

fix(send_message): 钉钉 standalone Markdown + 飞书表格渲染 / DingTalk markdown + Feishu tables - #39510

Closed
WenhuaXia wants to merge 5 commits into
NousResearch:mainfrom
WenhuaXia:fix/dingtalk-markdown-webhook-v2
Closed

fix(send_message): 钉钉 standalone Markdown + 飞书表格渲染 / DingTalk markdown + Feishu tables#39510
WenhuaXia wants to merge 5 commits into
NousResearch:mainfrom
WenhuaXia:fix/dingtalk-markdown-webhook-v2

Conversation

@WenhuaXia

Copy link
Copy Markdown

Summary

钉钉 / DingTalk

  • standalone delivery 从 msgtype: text 改为 msgtype: markdown
  • 被 API 拒绝时 fallback 到纯文本
  • 与 live DingTalk adapter 行为对齐,表格等 markdown 可正常渲染

飞书 / Feishu

  • 移除 _MARKDOWN_TABLE_RE workaround(历史代码强制表格降级为纯文本)
  • _MARKDOWN_HINT_RE 中添加 (^\\s*\\|) 表格检测,使表格路由到 post markdown 管道
  • 飞书已原生支持 post markdown 中的表格,该 workaround 已无需保留

Root Cause

Platform Problem Fix
DingTalk standalone delivery used msgtype: text, tables rendered as raw pipes Switch to msgtype: markdown with text fallback
Feishu _MARKDOWN_TABLE_RE forced tables to plain text as historical workaround Remove workaround; Feishu now natively supports tables in post markdown

References

Changes

  • tools/send_message_tool.py: markdown msgtype for DingTalk standalone delivery (+fallback)
  • gateway/platforms/feishu.py: remove table force-text workaround, add table detection to markdown hint regex

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery platform/dingtalk DingTalk adapter platform/feishu Feishu / Lark adapter labels Jun 5, 2026
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-markdown-webhook-v2 branch from dd41896 to c0b8f1d Compare June 6, 2026 14:31
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-markdown-webhook-v2 branch from c0b8f1d to f6e24a1 Compare June 6, 2026 14:54
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-markdown-webhook-v2 branch from f6e24a1 to 4df770a Compare June 19, 2026 06:40
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-markdown-webhook-v2 branch from 4df770a to b7f920a Compare June 20, 2026 13:54
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-markdown-webhook-v2 branch from b7f920a to 5d19a5d Compare June 21, 2026 03:46
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-markdown-webhook-v2 branch from 5d19a5d to c7d0745 Compare June 21, 2026 07:13
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-markdown-webhook-v2 branch from c7d0745 to ec1ba50 Compare June 21, 2026 19:49
- 钉钉: 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
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 P3 Low — cosmetic, nice to have platform/dingtalk DingTalk adapter 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