Skip to content

fix(feishu): route send_message media attachments#14365

Open
qwertysc wants to merge 1 commit into
NousResearch:mainfrom
qwertysc:fix/feishu-media-send-message
Open

fix(feishu): route send_message media attachments#14365
qwertysc wants to merge 1 commit into
NousResearch:mainfrom
qwertysc:fix/feishu-media-send-message

Conversation

@qwertysc

Copy link
Copy Markdown

Summary

  • route send_message Feishu delivery through _send_feishu(..., media_files=...) when attachments are present
  • attach media only on the final text chunk so chunked sends behave like other native-media platforms
  • allow media-only Feishu sends to use the native Feishu path instead of the generic unsupported-media fallback
  • update native-media support strings to include Feishu
  • add regression coverage for chunked Feishu media routing and media-only Feishu delivery

Root cause

_send_feishu() already accepted and processed media_files, but _send_to_platform() sent Feishu through the generic non-media path and never passed attachments along. That caused MEDIA: attachments to be dropped for Feishu targets.

Test plan

  • pytest -q tests/tools/test_send_message_tool.py -k "TestSendToPlatformFeishuMedia or TestSendToPlatformDiscordMedia::test_media_files_passed_on_last_chunk_only"
  • pytest -q tests/gateway/test_feishu.py -k "send_image_file_uploads_image_and_sends_image_message or send_image_file_with_caption_uses_single_post_message"

Fixes #10136

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter labels Apr 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing with PRs #10392, #8607, and #14049 — all fix the same Feishu media routing gap in send_message_tool.py.

@papperrollinggery

Copy link
Copy Markdown

Also consider pulling in the MEDIA: tag parsing from #15299 — lets users embed media in message text like MEDIA:/tmp/img.png alongside regular text, matching how Telegram/Discord handle it. PR already closed as duplicate.

@tipani86

Copy link
Copy Markdown

Tested the same fix path locally in a Feishu DM: routing MEDIA: attachments through _send_feishu(..., media_files=...) successfully delivered Markdown files as native Feishu attachments. +1 for getting this merged.

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 P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Feishu file sending broken: media_files parameter not passed to _send_feishu()

4 participants