fix(send_message): route media attachments through Feishu adapter#14892
fix(send_message): route media attachments through Feishu adapter#14892lzythebset wants to merge 1 commit into
Conversation
_send_feishu() already supports media_files via send_document / send_image_file / send_voice / send_video, mirroring the Telegram path, but _send_to_platform() omitted a dedicated Feishu branch. Media was dropped into the "Non-media platforms" fallback and stripped before reaching the adapter, so MEDIA: paths on Feishu produced a "MEDIA attachments were omitted" warning and delivered text only. Add a FEISHU branch parallel to Signal/Discord/Telegram that passes media_files to _send_feishu on the last chunk, and extend the warning and error strings to advertise Feishu alongside the other supported platforms.
|
Quick data point: we applied this patch (identical diff,
The change only adds a dispatch branch; Happy to add a unit test under |
|
Tested the same fix path locally in a Feishu DM: routing |
Summary
_send_feishu()intools/send_message_tool.pyalready supportsmedia_files— it routes PDFs/docs toadapter.send_document(), images tosend_image_file(), and audio/video tosend_voice()/send_video(), mirroring how Telegram is wired.However,
_send_to_platform()never gave Feishu a dedicated branch. Feishu messages fell into the generic "Non-media platforms" loop at L566, which calls_send_feishu(pconfig, chat_id, chunk, thread_id=...)without passingmedia_files. AnyMEDIA:/path/...tag emitted by the model (or media supplied by the caller) triggered the warning at L542:…and only text was delivered, even though the adapter had full file-upload support.
Change
Platform.FEISHUbranch next to the existing Signal/Matrix/Discord/Telegram branches that passesmedia_filesto_send_feishu()on the last chunk.No new dependencies; reuses
_send_feishu()'s existing media path. Non-Feishu platforms are unaffected.Repro before the fix
Any Hermes agent running on Feishu that tries
send_messagewithMEDIA:/some/file.pdfin the text — the file is dropped and the delivery result includes the "MEDIA attachments were omitted" warning.Test plan
python3 -c "import ast; ast.parse(open('tools/send_message_tool.py').read())"passes.MEDIA:/root/.hermes/profiles/crypto/cache/documents/onsite_report.pdf— before the patch only the text was sent with an omitted-media warning; after the patch the PDF is uploaded and attached to the chat as a document.tests/gateway/test_feishu.pysuite to confirm no regression; the patch only adds a dispatch branch and does not touch adapter behavior.