Skip to content

Bug Report: Feishu (Lark) Markdown Table Rendering Regression in v0.13.0 #21778

Closed

Description

@hellojackyleon

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

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

  1. added
    type/bugSomething isn't working
    comp/gatewayGateway runner, session dispatch, delivery
    P2Medium — degraded but workaround exists
    on May 8, 2026
  2. alt-glitch commented on May 8, 2026

    @alt-glitch

    Related to #9549, #18756, #9536. The forced text fallback for tables was introduced to avoid silent table drops in post mode (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.

  3. teknium1 commented on Jul 20, 2026

    @teknium1
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/gatewayGateway runner, session dispatch, deliveryplatform/feishuFeishu / Lark adaptertype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions