Conversation
….2 port) Port of the Card 2.0 markdown fix from PR NousResearch#45036 (#30bb6d078) to Hermes v0.18.2 where the Feishu adapter moved from gateway/platforms/feishu.py to plugins/platforms/feishu/adapter.py (5662 lines). The original PR was opened against the 422-line pre-v0.17.0 adapter. After the rename in release commit 9de9c25 (v0.18.0 chore: release), the diff no longer matches any tracked file — even though the underlying bug (tag:"md" post renderer doesn't support tables/code blocks/lists/ headings/italic/strikethrough/blockquotes) persists in main and breaks Feishu users. Fix: * _build_outbound_payload routes markdown content through Card 2.0 (schema: "2.0", tag: "markdown") — Feishu's full CommonMark renderer. * Plain prose still goes as plain text. * _POST_CONTENT_INVALID_RE extended to detect card-rejection errors ("invalid card content" / "invalid content format") so the existing send/edit fallback pipeline catches them and falls back to text. * 3 fallback sites in the send pipeline now treat both "post" and "interactive" as fall-back-eligible message types. Tests: * 6 existing assertions updated to expect msg_type="interactive" and Card 2.0 schema instead of post rows. * _build_post_payload unit tests untouched (helper still used by media captions and edit fallback). * 208/208 tests pass on clean v0.18.2 (8e73481). Refs: * PR NousResearch#45036 — original fix (still open, never merged) * Issue NousResearch#27469 — saturated cluster tracker * Issue NousResearch#12114 — canonical "tag:\"table\"" partial fix
|
cc @hermes-sweeper Manual port of #45036 to current What this PR changes:
This is a manual port, not a cherry-pick — per your guidance on #45036. Diff: 2 files, +67 / -44. Branch: Will keep an eye on #27469 cluster for any reviewer-consolidation signal. |
Related: #68084 already implements the current-path table-only Card 2.0 route. This PR instead sends all detected Markdown through an interactive card, so these are competing scopes rather than duplicates. |
|
Thanks @alt-glitch. Noted — #68121 (post+md path) takes precedence here. Will leave #68507 open as a Card 2.0 fallback in case #68121 turns up regressions on the markdown table / mixed-content paths. No further pushes from my side; not adding noise to the review queue. Closing the loop on this thread. Will re-engage if I see regression reports. |
|
Thanks for the careful current-path port and for preserving the media-caption post builder. Automated hermes-sweeper review found the user-visible Markdown/table routing issue is already implemented on
Closing as implemented on main. |
Summary
Ports the Card 2.0 markdown fix from #45036 to Hermes v0.18.2 via manual port (not cherry-pick) per the sweeper review on #45036 comment 4969941933.
The original PR was opened against the 422-line pre-v0.17.0
gateway/platforms/feishu.py. After release9de9c25f6(and the file-move commit referenced by the sweeper) the active adapter isplugins/platforms/feishu/adapter.py(5662 lines in v0.18.2). A cherry-pick of the original commit fails because the source path no longer exists.What changed (in
plugins/platforms/feishu/adapter.py)_build_outbound_payloadnow routes markdown through Feishu Card 2.0 (schema: "2.0",tag: "markdown") — the full CommonMark renderer — instead of the stripped-downtag: "md"post element that silently drops tables, code blocks, lists, headings, italic, strikethrough, and blockquotes._POST_CONTENT_INVALID_REextended to detect card-rejection errors ("invalid card content"/"invalid content format")."post"and"interactive"as fallback-eligible (msg_type in ("post", "interactive")).What was deliberately not changed
Per the sweeper review:
_build_markdown_post_rowsis preserved as-is. It is still live — referenced by_build_post_payload()and_build_media_post_payload()for media captions. The original PR rewrote it, but the sweeper review flagged this as out of scope. No caption regression test was added because no caption behavior changed._build_markdown_post_payloadis also untouched; cards are not used for media captions.Tests
pytest tests/gateway/test_feishu.py→ 208 passed on clean v0.18.2 (HEAD8e734810d)._build_outbound_payloadconsumers updated to expectmsg_type="interactive"and Card 2.0 schema ({"schema": "2.0", "body": {"elements": [{"tag": "markdown", "content": ...}]}}) instead of post rows._build_post_payloadunit tests untouched (the helper still serves media captions).Why a separate PR (vs. reviving #45036)
#45036's diff targets the old
gateway/platforms/feishu.pypath, which no longer exists in main. The fix has been a saturated-cluster casualty (tracking issue #27469, canonical partial fix #12114) — opening a fresh PR with a clean rebase on current main and a body that links the original avoids the duplicate-closure risk and gives maintainers a diff that actually applies.Refs
tablecomponent #12114 — canonical"tag:"table""partial fix