Skip to content

fix(feishu): preserve markdown around tables - #61377

Closed
lazydao wants to merge 1 commit into
NousResearch:mainfrom
lazydao:agent/feishu-markdown-table-post
Closed

fix(feishu): preserve markdown around tables#61377
lazydao wants to merge 1 commit into
NousResearch:mainfrom
lazydao:agent/feishu-markdown-table-post

Conversation

@lazydao

@lazydao lazydao commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Fixes Feishu/Lark markdown rendering when an outgoing message contains Markdown tables.

Previously, any content that looked like a table forced the entire outgoing message to msg_type=text. That kept the table visible but exposed headings, emphasis, inline code, links, and other Markdown markers as raw text.

Details

  • Keeps table-containing messages on Feishu post payloads.
  • Emits table blocks as plain text rows because Feishu post md rows do not render tables reliably.
  • Preserves surrounding prose as md rows.
  • Leaves fenced code blocks untouched.
  • Adds regression coverage for mixed Markdown/table segmentation and the outbound send path.

This is intentionally narrower than the Card v2 table approach in #12114: it preserves existing post-message behavior and client compatibility without switching the whole response to an interactive card.

Validation

  • scripts/run_tests.sh tests/gateway/test_feishu.py -q
  • Result: 212 passed
  • git diff --check

@lazydao
lazydao force-pushed the agent/feishu-markdown-table-post branch from dba663b to bd97a01 Compare July 9, 2026 08:45
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter labels Jul 9, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Competing approach in the saturated Feishu markdown-table cluster (canonical open #12114; tracked by #27469). This PR keeps table-containing messages on post payloads and splits the table block into plain-text rows while leaving surrounding prose as md rows — distinct from the card-table rendering PRs (#12114, #22272, #35906). Not a duplicate; a maintainer should pick the canonical fix for this cluster.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused Feishu fix. The premise remains present on current main: _build_outbound_payload() sends any detected table as text at plugins/platforms/feishu/adapter.py:4524-4533, which bypasses the adjacent markdown-post path. This patch's table-to-text-row segmentation (bd97a0176f21, plugins/platforms/feishu/adapter.py:617-624) preserves surrounding md rows and intentionally skips fenced code blocks.

The PR's added coverage exercises mixed markdown/table segmentation and verifies the send path selects post. The related discussion identifies Card v2 table rendering in #12114 as a distinct competing approach, so choosing a canonical rendering strategy remains a maintainer decision rather than a correctness concern with this patch.

Automated hermes-sweeper review.

@lazydao
lazydao force-pushed the agent/feishu-markdown-table-post branch from bd97a01 to 1931071 Compare July 10, 2026 22:33
@lazydao
lazydao marked this pull request as ready for review July 10, 2026 22:33
@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 11, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing — fixed on main by #68121. Your approach (table blocks as plain-text rows inside an otherwise markdown-rendering post) solved the real complaint — one table no longer destroys the whole message's formatting — but Feishu's server-side fix made the special-casing unnecessary: post/md now renders GFM tables natively, so the whole message renders. Thanks!

@teknium1 teknium1 closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/feishu Feishu / Lark adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants