Skip to content

fix(wecom): send MEDIA attachments when no live gateway is routed - #132

Open
pxpy wants to merge 1 commit into
NousResearch:mainfrom
pxpy:fix/standalone-media-attachments
Open

pxpy wants to merge 1 commit into
NousResearch:mainfrom
pxpy:fix/standalone-media-attachments

Conversation

@pxpy

@pxpy pxpy commented Dec 1, 2026

Copy link
Copy Markdown

What does this PR do?

When no live gateway adapter is available, core routes a media send to the plugin's standalone_sender_fn with media_files / force_document. _send_via called only adapter.send, so the text landed and the attachment was dropped while the send reported success.

Now it sends the text, then each file through its native adapter method (send_image_file / send_video / send_voice, or send_document when forced), and returns an error when an upload fails instead of reporting success.

Relates to NousResearch/hermes-agent#153045 (the report against core). This is the same fix as my hermes-agent#153227, re-filed here now that WeCom lives in this repo.

Test plan

PYTHONPATH=<hermes-agent> python -m pytest wecom/tests/test_wecom_standalone_media.py -q — 5 passed: image rides send_image_file, force_document routes to send_document, a voice-only send skips the empty text bubble, a failed upload is reported, a text-only send is unchanged.

Full wecom/ suite: 100 passed, 2 failed (test_connect_records_handshake_failure_details, test_download_remote_bytes_blocks_connect_time_rebind); both fail identically on the unmodified tree and are environment (httpx proxy/IPv6) issues.

Without a running gateway, core routes a media send to
``standalone_sender_fn`` with ``media_files`` / ``force_document``.
``_send_via`` called only ``adapter.send``, so the text landed and the
attachment was dropped while the send reported success.

Send the text, then each file through its native adapter method
(document when forced) and surface an upload failure instead of
dropping it. Relates to NousResearch/hermes-agent#153045.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant