Repository navigation
Description
Summary
In Hermes Agent v0.13.0, the Feishu (Lark) gateway's _build_outbound_payload method contains an overly defensive fallback that forces all messages containing Markdown tables to be sent as plain text type. This causes Markdown tables to render as raw source code in Feishu clients, which is a worse user experience than the alternative.
Environment
- Hermes Agent version: v0.13.0 (commit range: PR feat: add video_analyze tool for native video understanding #19301 area)
- Platform: Feishu (Lark) via
gateway/platforms/feishu.py - Python version: 3.10+
Current Behavior
When a response contains a Markdown table (detected by _MARKDOWN_TABLE_RE), the gateway unconditionally downgrades the message to text type:
# feishu.py ~line 4007-4013
if _MARKDOWN_TABLE_RE.search(content):
text_payload = {"text": content}
return "text", json.dumps(text_payload, ensure_ascii=False)Result in Feishu client: The entire message renders as raw Markdown source (including |, -, * characters), making it unreadable.
Expected Behavior
The message should be sent as post type (rich content), allowing Feishu to render headers, bold text, code blocks, and lists properly. While Feishu's post type md elements do not natively render Markdown tables (they display as blank), this is still preferable to showing raw table source code.
Proposed Fix Options
Option A: Remove the forced downgrade (Recommended)
Comment out or remove the _MARKDOWN_TABLE_RE.search(content) check. Let tables go through post type — they will display as blank in Feishu, but all other Markdown elements render correctly.
Option B: Convert tables to Feishu native format
Pre-process Markdown tables into Feishu post type's native table structure before sending. More complex but provides full table rendering.
Option C: Configurable behavior
Add a gateway configuration option feishu.markdown_table_fallback = "text" | "post" | "native" to let users choose the behavior.
Workaround (Current)
Manually patch feishu.py to comment out the forced downgrade:
# NOTE: Disabled to allow markdown tables to render via post type
# if _MARKDOWN_TABLE_RE.search(content):
# text_payload = {"text": content}
# return "text", json.dumps(text_payload, ensure_ascii=False)Then restart gateway: hermes gateway restart
Additional Context
- This regression was introduced as a defensive measure (comment in code: "Feishu post-type 'md' elements do not render markdown tables")
- However, the cure (raw source code) is worse than the disease (blank table area)
- The Hermes public cloud instance does not exhibit this behavior, suggesting the public deployment may use a different code path or version
Checklist
- I have searched existing issues to ensure this is not a duplicate
- I have tested this on the latest released version (v0.13.0)
- I have provided a minimal reproduction scenario
Labels suggested: bug, platform:feishu, gateway, regression
Activity
alt-glitch commentedon May 8, 2026
Related to #9549, #18756, #9536. The forced
textfallback for tables was introduced to avoid silent table drops inpostmode (see #18756). Multiple competing fix PRs exist (#12114, #15956, #16194). This issue documents the same underlying Feishu markdown table limitation from a different angle — the defensive fallback itself is now the worse UX.teknium1 commentedon Jul 20, 2026
Fixed on main by #68121 (salvage of #58019 by @JasonFang1993 and #29552 by @M1racleShih, authorship preserved). The Feishu adapter no longer downgrades table-containing messages to plain text — markdown tables (and all surrounding formatting: headings, bold, links, code) now render via Feishu's post/md pipeline, which supports GFM tables server-side as of their 2026 API update. If a lagging tenant rejects a post payload, the adapter still degrades gracefully to plain text. Available on next update from main.