hermes - 💡(How to fix) Fix Bug Report: Feishu (Lark) Markdown Table Rendering Regression in v0.13.0

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…

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.

Root Cause

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.

Fix Action

Fix / Workaround

Workaround (Current)

Manually patch feishu.py to comment out the forced downgrade:

Code Example

# feishu.py ~line 4007-4013
if _MARKDOWN_TABLE_RE.search(content):
    text_payload = {"text": content}
    return "text", json.dumps(text_payload, ensure_ascii=False)

---

# 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)
RAW_BUFFERClick to expand / collapse

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 #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

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