Conversation
Enhance send_message_tool to support rich-media attachments via MEDIA tags and bare file-path auto-detection, with native routing for DingTalk and Feishu platforms. - Update schema description with MEDIA attachment instructions - Add two-stage media extraction: MEDIA:<path> tags + bare absolute paths via BasePlatformAdapter.extract_local_files() - Add native DingTalk routing block using dingtalk_send_proactive() with media upload support (image/video/audio/file) - Add native Feishu routing block with media_files passthrough - Rewrite _send_dingtalk() to prefer Robot OpenAPI (AppKey/Secret) over legacy DINGTALK_WEBHOOK_URL, with graceful fallback - Update platform support lists in error messages to #
|
Hi @alt-glitch, thanks for the detailed cross-referencing! 🙏 You're spot on — this PR touches the We're the DingTalk (钉钉) Open Platform team at Alibaba — @PeterGuy326 and @spike2204 are colleagues. This is the final piece of our fine-grained PR series, extracted from the original stacked #14336. What this PR specifically does:
Regarding consolidation with #12769: We fully agree — all 8 PRs in this series (#17364–#17371) are tracked under the umbrella #12769. Once reviewed, we'll close the original stacked PRs (#14333–#14336). The 8 fine-grained PRs can be merged in any order since each is self-contained against Looking forward to your feedback! 🚀 |
|
Hi @alt-glitch 👋 — just a gentle follow-up on this PR series (#17364 – #17371). We'd really appreciate it if these could be prioritized for review. Here's why:
We're happy to hop on a quick call, do a live walkthrough, or address any feedback asynchronously — whatever works best for the team. Thanks again for all the work on Hermes! 🙏 |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused media-routing work. Feishu attachment delivery is already present on current main, but the remaining DingTalk work needs a current-architecture salvage.
Problems
tools/send_message_tool.py:1362importsdingtalk_send_proactive, but this PR changes onlytools/send_message_tool.pyand current main has no definition for that symbol. The proposed OpenAPI path cannot run as submitted.- Current main moved DingTalk and Feishu delivery into platform plugins. Feishu media already routes through its registered standalone sender at
tools/send_message_tool.py:960-982; the former core helper targeted by this branch no longer exists. - The bare-path addition at PR
tools/send_message_tool.py:284-286appends paths directly. Current main's bare-path contract requiresfilter_local_delivery_paths()(gateway/platforms/base.py:3487-3497) before native upload. - The PR has no tests; its only changed path is
tools/send_message_tool.py.
Suggested changes
- Move the DingTalk OpenAPI upload/send implementation into
plugins/platforms/dingtalk/adapter.py::_standalone_send, following the registered plugin sender contract. - Preserve current safe bare-path filtering and add DingTalk OpenAPI/webhook-fallback and media-routing coverage.
Automated hermes-sweeper review.
|
|
||
| if client_id and client_secret: | ||
| try: | ||
| from gateway.platforms.dingtalk import dingtalk_send_proactive |
There was a problem hiding this comment.
dingtalk_send_proactive is not defined by this one-file PR and is absent from current main. This import makes the intended OpenAPI route unavailable; salvage the sender and upload implementation into the DingTalk plugin's registered standalone sender instead.
| # Stage 2 matters for the common case where the agent just pastes the | ||
| # file path it already knows (what the user asked about in this flow). | ||
| media_files, cleaned_message = BasePlatformAdapter.extract_media(message) | ||
| bare_paths, cleaned_message = BasePlatformAdapter.extract_local_files(cleaned_message) |
There was a problem hiding this comment.
When salvaging this onto current main, pass extracted bare paths through BasePlatformAdapter.filter_local_delivery_paths() before adding them to media_files; current MEDIA-tag extraction is explicitly filtered before dispatch.
Summary
Enhance
send_message_toolto support rich-media attachments via MEDIA tags and bare file-path auto-detection, with native routing for DingTalk and Feishu platforms.Changes
[[audio_as_voice]]directive)MEDIA:<path>tags + bare absolute paths viaBasePlatformAdapter.extract_local_files()dingtalk_send_proactive()with media upload supportmedia_filespassthrough_send_dingtalk()to prefer Robot OpenAPI (AppKey/Secret) over legacy DINGTALK_WEBHOOK_URL, with graceful fallbackRelated
Part of the DingTalk adapter enhancement series — see #12769 for the umbrella PR.