Skip to content

feat(gateway): support Feishu interactive card (msg_type=interactive) in send_message - #37830

Open
MaHaoHao-ch wants to merge 1 commit into
NousResearch:mainfrom
MaHaoHao-ch:fix/37777-feishu-interactive-card
Open

feat(gateway): support Feishu interactive card (msg_type=interactive) in send_message#37830
MaHaoHao-ch wants to merge 1 commit into
NousResearch:mainfrom
MaHaoHao-ch:fix/37777-feishu-interactive-card

Conversation

@MaHaoHao-ch

Copy link
Copy Markdown

What does this PR do?

This PR adds support for Feishu interactive cards (msg_type=interactive) in the send_message pipeline. Previously, agents could only send plain text or markdown post messages to Feishu, which rendered structured data (like tables) poorly.

Related Issue

Fixes #37777

Type of Change

  • New feature (non-breaking change that adds functionality)

Changes Made

  • gateway/platforms/feishu.py: Added _is_feishu_card_json static method to detect Feishu interactive card JSON format
  • gateway/platforms/feishu.py: Modified _build_outbound_payload to route card JSON as msg_type='interactive'
  • Supports standard card structures: config+elements, header+elements, template type, i18n
  • Enables agents to send structured Feishu cards with proper formatting, colors, and layout control

How to Test

  1. Send a Feishu card JSON through the agent send_message interface
  2. The card should be rendered with proper formatting instead of being treated as plain text

Checklist

Code

  • My commit messages follow Conventional Commits
  • My PR contains only changes related to this fix/feature
  • Tested on: Windows 10

Documentation & Housekeeping

  • N/A - Code comments explain the new functionality

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have platform/feishu Feishu / Lark adapter comp/gateway Gateway runner, session dispatch, delivery labels Jun 3, 2026
… in send_message

- Add _is_feishu_card_json static method to detect Feishu card JSON
- Modify _build_outbound_payload to route card JSON as msg_type='interactive'
- Support standard card structures: config+elements, header+elements, template, i18n
- Enables agents to send structured Feishu cards for better formatting

Closes NousResearch#37777
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused Feishu card-routing contribution. The feature is still needed on current main: plugins/platforms/feishu/adapter.py:4524-4534 only classifies outbound content as text or post.

Problems

  • The PR edits gateway/platforms/feishu.py, but that adapter was relocated to plugins/platforms/feishu/adapter.py by 552adbe08; GitHub reports this PR as DIRTY, so the implementation needs a targeted transplant rather than a clean merge.
  • The PR adds no regression coverage for generic card JSON sent through adapter.send(). Existing tests only verify internally generated approval/update cards use interactive (tests/gateway/test_feishu_approval_buttons.py:88-115).

Suggested changes

  • Apply the classifier at current plugins/platforms/feishu/adapter.py:4524 and preserve the table-to-text branch.
  • Add send-path tests for a valid card JSON becoming msg_type="interactive", plus non-card JSON/Markdown/table controls.

Automated hermes-sweeper review.

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 type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support Feishu interactive card (msg_type=interactive) in send_message

3 participants