fix(feishu): re-enable post-mode rendering for markdown tables - #29166
fix(feishu): re-enable post-mode rendering for markdown tables#29166John15Wil wants to merge 1 commit into
Conversation
|
Hi @John15Wil — I independently arrived at the same fix and just dropped my duplicate (#50640). Thanks for getting here first! One thing that might help this land: there's no test coverage yet, and reviewers have flagged the recurring nature of this bug (#26108 was closed by its author with "open too long, no longer relevant" despite three contributors verifying it worked). A regression test for the routing decision could give the next reviewer something concrete to point to. Here are the 5 tests I wrote for #50640 — they target Feel free to lift these into your PR if useful (MIT-licensed, no attribution needed):
|
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying the table-routing regression. The underlying routing branch is still present on current main, but this patch needs a small salvage before it can affect the active adapter.
Problems
gateway/platforms/feishu.pywas deleted by bundled-plugin migration commit476d8d9ccbee1b36d8fb6f4fabc0081c3e996cd2. Current Feishu sends callplugins/platforms/feishu/adapter.py:1904, whose_build_outbound_payload()still forces matching tables totextatplugins/platforms/feishu/adapter.py:4528.- No regression test accompanies the routing change. Existing post-routing coverage at
tests/gateway/test_feishu.py:2693-2732covers inline markdown, not tables.
Suggested changes
- Apply the same conditional to
plugins/platforms/feishu/adapter.py:4524-4534. - Add direct routing assertions for plain text, table-only content, and mixed markdown/table content, including the generated
tag: mdpayload.
Automated hermes-sweeper review.
| # Markdown tables render correctly in post-type 'md' elements as of | ||
| # mid-May 2026 (Feishu server-side now parses GFM tables). The earlier | ||
| # forced-text-mode fallback (commit 8e18d10) is no longer needed — | ||
| # tables now go through the post path with the rest of markdown. |
There was a problem hiding this comment.
Current main deleted this adapter in 476d8d9ccbee1b36d8fb6f4fabc0081c3e996cd2; the live method is now plugins/platforms/feishu/adapter.py:4524. Please salvage this conditional into that active plugin path so it changes shipped behavior.
Feishu's post-type 'md' elements now correctly render GFM tables as of mid-May 2026 — the server-side parser was updated to handle the table syntax. The earlier defensive fallback (commit 8e18d10, 2026-04-22) that forced text-mode for any content matching _MARKDOWN_TABLE_RE is no longer needed and is in fact harmful: tables now appear as raw markdown source instead of rendered grids. Empirically verified by sending a 3x3 table directly via the Feishu post API — it renders as a proper bordered table on the client. This change collapses the table check into the existing markdown-hint branch so tables go through the same post pipeline as other markdown. Test: send a message containing a markdown table — it should render as a proper table grid in Feishu instead of raw '| col |' source.
fc6c03e to
ee2263c
Compare
|
Thanks! I rebased the PR onto current main. The fix now targets the active Feishu plugin adapter, and I added direct routing regression tests for plain text, table-only content, and mixed Markdown/table content, including tag: md payload assertions. The targeted regression tests pass. Please take another look when convenient.
|
Summary
Feishu's post-type
mdelements now correctly render GFM markdown tables as of mid-May 2026 — the server-side parser was updated to handle the table syntax. The earlier defensive fallback (commit 8e18d10, 2026-04-22) that forced text-mode for any content matching_MARKDOWN_TABLE_REis no longer needed and is in fact harmful: tables now appear as raw markdown source instead of rendered grids.Empirical verification
Sent a 3×3 table directly via the Feishu post API as
{"tag":"md", "text":"| A | B | C |\n|---|---|---|\n| 1 | 2 | 3 |\n| 4 | 5 | 6 |"}— Feishu rendered it as a proper bordered table on the client.After applying this patch and restarting the gateway, sending the same table through the agent → gateway pipeline now renders as a proper table grid in Feishu instead of raw
| col |source.Change
Collapses the explicit
_MARKDOWN_TABLE_REcheck into the existing_MARKDOWN_HINT_REbranch so tables go through the same post pipeline as other markdown:Test plan
Reverts the over-defensive workaround from #8e18d10.