hermes - 💡(How to fix) Fix Feishu replies render raw Markdown while normal messages render correctly

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

**已入库 Shared Intel**
🔗 -> 查看 Base 记录

---

## 🌐 双语摘要 | Google CloudWhat is a Multi-Agent System?

#### 📌 What is MAS? / 什么是多智能体系统?

**EN:** A multi-agent system ... **distributed control** ...
**CN:** 多智能体系统 ... **分布式控制** ...

---

python -m pytest tests/gateway/test_feishu.py tests/gateway/test_run_progress_topics.py tests/gateway/test_stream_consumer.py -q
python -m ruff check gateway/platforms/feishu.py tests/gateway/test_feishu.py
python -m py_compile gateway/platforms/feishu.py
RAW_BUFFERClick to expand / collapse

Problem

Feishu/Lark replies can lose Markdown rendering and show the raw Markdown syntax to users, while non-reply messages render correctly.

A real example from the Feishu channel:

✅ **已入库 Shared Intel**
🔗 -> 查看 Base 记录

---

## 🌐 双语摘要 | Google Cloud — What is a Multi-Agent System?

#### 📌 What is MAS? / 什么是多智能体系统?

**EN:** A multi-agent system ... **distributed control** ...
**CN:** 多智能体系统 ... **分布式控制** ...

When Hermes sends this as a Feishu reply, the client displays **bold**, ##, ####, and --- literally. The same style of content sent as a normal non-reply Feishu message renders as expected.

What seems to be happening

Hermes already chooses msg_type=post for Markdown-like Feishu output. However, the reply path still relies on post payload rows containing a single {"tag": "md", "text": ...} element.

That md element appears to render unreliably in Feishu's reply surface, even though it works for normal creates. The result is that the message is technically delivered as a post, but Markdown syntax is visible instead of rendered.

This may overlap with the broader formatting concerns in #9816, but the triggering condition here is specifically Feishu/Lark replies or topic replies.

Suggested fix

Keep the existing non-reply path unchanged, since normal Feishu Markdown messages are already working.

For reply and thread/topic reply sends only:

  1. Continue using msg_type=post.
  2. Convert Markdown into native Feishu rich-text post elements instead of a tag: md block.
  3. Map common Markdown constructs to native elements:
    • headings -> text with bold style
    • **bold**, *italic*, ~~strike~~, <u>underline</u> -> text with style arrays
    • inline code -> text with code style
    • fenced code blocks -> code_block
    • links -> a
    • --- -> hr
  4. Preserve the current tag: md behavior for non-reply sends to avoid changing the working path.
  5. Add regression tests for both direct replies and Feishu topic/thread replies to assert that reply payloads do not include raw tag: md Markdown blocks.

Draft implementation

I opened a draft PR with one possible implementation:

  • #24318

The PR keeps ordinary Feishu sends on the existing post + md path, but uses native post elements when reply_to or thread reply metadata is present.

Validation used in the draft PR

python -m pytest tests/gateway/test_feishu.py tests/gateway/test_run_progress_topics.py tests/gateway/test_stream_consumer.py -q
python -m ruff check gateway/platforms/feishu.py tests/gateway/test_feishu.py
python -m py_compile gateway/platforms/feishu.py

The local targeted suite passed with 307 passed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING