Skip to content

fix(feishu): send Markdown Bot replies as native Markdown cards - #34

Merged
DoodleBears merged 1 commit into
mainfrom
claude/project-thread-omu4dl
Oct 27, 2026
Merged

DoodleBears merged 1 commit into
mainfrom
claude/project-thread-omu4dl

Conversation

@DoodleBears

Copy link
Copy Markdown
Collaborator

Requested by Vain · project thread

Fixes BotHarness/DeepSeekBot#2792.

What was wrong

In Bot mode, the Lark replies DeepSeekBot sends always went out as msg_type: text. That covers both replyChecked (a reply to the source message) and postConversationChecked (a post to a group). So bold, headings and tables showed up as raw **, # and |. DSH's own chat already renders Markdown through a schema 2.0 Markdown card.

Change

  • A new checkedTextFormat(text) returns markdown when the text uses Markdown syntax. That means headings, lists, quotes, code, tables, bold, strikethrough or links. Otherwise it returns plain.
  • Markdown replies go out as interactive with the same native Markdown element as chat. sendProactiveText and replyChecked now build the message from one shared helper.
  • These stay text on purpose: plain replies, and any reply containing a text-message <at user_id> mention.

Known trade-off: a group report posted with Markdown will no longer get an Echo confirmation, because the echo of an interactive card is not read back. Plain reports keep it as before.

Tests

  • New unit coverage of the format detection, plus a replyChecked test that checks the interactive card payload and that a plain reply stays text.
  • test/reachable-feishu.test.mjs now also checks a Markdown group post.
  • Full npm test: 3638 passed, 0 failed. Both this branch and main show the same pre-existing cancellations in this environment (215 vs 214; the one extra is the new test, which passes when run on its own).
  • Not checked live against a real Lark bot.

Generated by Claude Code

Checked replies and checked group posts always went out as msg_type
text, so Markdown from Bot mode showed raw asterisks, hashes and pipes
in Lark. A reply that uses Markdown now goes out as the same schema 2.0
Markdown card that chat already uses. Plain replies and replies with a
text-message <at user_id> mention stay text, because other Bots and own
Echo confirmation only read text messages.

Refs BotHarness/DeepSeekBot#2792

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lpx6qnuRKPyBQWbwohCfMZ
@DoodleBears DoodleBears self-assigned this Oct 27, 2026
@DoodleBears
DoodleBears merged commit 7505ce6 into main Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bot 模式发往飞书的回复恒为纯文本:postConversationChecked 未向 sendProactiveText 传 format

2 participants