Skip to content

fix(feishu): render markdown replies as interactive cards - #61365

Open
WhaleLiu-2173 wants to merge 1 commit into
NousResearch:mainfrom
WhaleLiu-2173:fix/feishu-interactive-card-markdown
Open

fix(feishu): render markdown replies as interactive cards#61365
WhaleLiu-2173 wants to merge 1 commit into
NousResearch:mainfrom
WhaleLiu-2173:fix/feishu-interactive-card-markdown

Conversation

@WhaleLiu-2173

Copy link
Copy Markdown

Summary

  • render Feishu outbound replies as interactive cards so Markdown tables and common Markdown formatting display correctly
  • keep streaming send/edit message type stable as interactive to avoid cross-type update failures
  • preserve plain-text fallback when Feishu rejects the rich payload

Tests

  • .venv/bin/python -m pytest tests/gateway/test_feishu.py -q -k "send_ or edit_message or build_post_payload or interactive_card_for or streaming_send_then_table_edit"
  • .venv/bin/python -m pytest tests/gateway/test_stream_consumer_fresh_final.py -q
  • .venv/bin/python -m pytest tests/gateway/test_stream_consumer.py::TestFinalizeCapabilityGate tests/gateway/test_stream_consumer.py::TestEditMessageFinalizeSignature -q
  • git diff --check

Note: full tests/gateway/test_feishu.py still has two unrelated local webhook failures because aiohttp.web is None.

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins platform/feishu Feishu / Lark adapter P3 Low — cosmetic, nice to have sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jul 9, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the Feishu table-rendering gap. Current main confirms the underlying issue: plugins/platforms/feishu/adapter.py:4524-4534 explicitly sends table-shaped replies as plain text because post markdown tables render blank.

Problems

  • The fallback migration is incomplete. The changed interactive branch still relies on _POST_CONTENT_INVALID_RE (plugins/platforms/feishu/adapter.py:166), which only matches the literal post-type validation message. The updated fallback fixture in tests/gateway/test_feishu.py:471 also returns that post-specific message despite the request becoming interactive, so it does not validate the promised fallback for an interactive-card rejection.

Suggested changes

  • Verify the interactive-card validation error/code, broaden the shared predicate to that verified response shape, and cover send/edit fallback using it before relying on the plain-text fallback path.

Automated hermes-sweeper review.

)
except Exception as exc:
if msg_type != "post" or not _POST_CONTENT_INVALID_RE.search(str(exc)):
if msg_type != "interactive" or not _POST_CONTENT_INVALID_RE.search(str(exc)):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now gates an interactive fallback with _POST_CONTENT_INVALID_RE, but that regex only matches the literal post-type validation message (adapter.py:166). The updated tests keep that post-specific fixture, so they do not prove an interactive-card rejection reaches the text fallback. Please use the verified interactive validation error/code and cover it here and in the edit path.

@teknium1 teknium1 added 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins 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