fix(slack): support MEDIA attachments in send_message - #67219
Conversation
Slack could already deliver files in-channel via the gateway, but send_message omitted MEDIA for Slack and told the model it was unsupported — causing agents to inconsistently refuse PDF sends. Wire Slack through files_upload_v2 in the standalone sender.
Add standalone-sender media cases and route coverage; point the non-media platform assertions at SMS now that Slack supports MEDIA.
teknium1
left a comment
There was a problem hiding this comment.
Thanks for wiring the missing Slack media route. The premise is confirmed on current main: tools/send_message_tool.py:1035-1063 classifies Slack as non-media and invokes its standalone sender without media_files.
Problems
plugins/platforms/slack/adapter.py:5007constructs the mediaAsyncWebClientwithout the existing_resolve_slack_proxy_url()/_apply_slack_proxy()setup. Current Slack clients apply that configuration atplugins/platforms/slack/adapter.py:1080-1082; media delivery would bypass configured proxy andNO_PROXYbehavior.
Suggested changes
- Apply
_apply_slack_proxy(client, _resolve_slack_proxy_url())after constructing the media client, and add coverage for that path.
Automated hermes-sweeper review.
| ) | ||
| } | ||
|
|
||
| client = _AsyncWebClient(token=token) |
There was a problem hiding this comment.
This media client bypasses Slack's established proxy setup. Please apply _apply_slack_proxy(client, _resolve_slack_proxy_url()) here, as the connected clients do at current-main adapter.py:1080-1082, and add a proxy-path test.
|
Merged via #69482 — your commit was cherry-picked/reapplied onto current main with your authorship preserved in git history: your MEDIA-in-send_message implementation (caption-on-upload, per-file warnings, chunked routing, tests) won the three-way adjudication and was cherry-picked directly. Thanks for the contribution! |
Summary
MEDIA:delivery (files_upload_v2), butsend_messageexplicitly omitted Slack media and reported it as unsupported — so models inconsistently refused PDF/file sends (including after succeeding earlier in the same thread).send_messagemedia path: plugin_standalone_senduploads viafiles_upload_v2, with caption-on-upload for single captionable files (same pattern as Discord/WhatsApp).test_slack_send_message_media.py; Signal media tests now use SMS as the non-media platform).Test plan
scripts/run_tests.sh tests/tools/test_slack_send_message_media.py tests/tools/test_signal_media.py -qsend_messagea local PDF withMEDIA:/path/file.pdfto a channel and confirm the file appearsinitial_comment(no duplicate text message)MEDIA:delivery still works unchanged