feat(wecom): add voice message send support via media upload#12521
Closed
chqchshj wants to merge 4 commits into
Closed
feat(wecom): add voice message send support via media upload#12521chqchshj wants to merge 4 commits into
chqchshj wants to merge 4 commits into
Conversation
added 2 commits
April 19, 2026 18:48
- Add send_voice() to upload audio and send as WeCom voice message - Add _upload_media() for WeCom temporary media store upload - Add _convert_to_amr() for ffmpeg-based audio conversion (WeCom requires AMR 8kHz mono) - Graceful fallback to text when voice upload/convert fails - Auto-cleanup of temporary converted files
- Handle incoming voice messages in _build_event (previously dropped) - Download voice audio from WeCom media store via _download_voice_media - Cache locally using cache_audio_from_bytes for STT transcription pipeline - Set MessageType.VOICE + media_urls so gateway auto-transcribes - Make _build_event async (requires media download) - Update tests to use async/await
18 tasks
added 2 commits
April 19, 2026 19:55
WeCom voice messages are in AMR format which most STT engines don't support. Convert to WAV (16kHz mono) via ffmpeg before caching for transcription.
Collaborator
|
Overlaps with #8312 which also adds voice message support for the WeCom callback adapter. Maintainers should decide which approach to merge. |
Contributor
Author
|
Closing this out for now from my side to reduce stale/open Hermes Agent PRs. Thanks for the review and context. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add voice message send support for WeCom (企业微信) callback adapter.
When the agent generates a TTS voice reply, the adapter now uploads the audio file to WeCom's temporary media store and sends it as a native voice message, instead of falling back to text.
Changes
/cgi-bin/message/send/cgi-bin/media/upload(respects 2MB voice limit)Design decisions
send_voice(text-based reply)_resolve_app_for_chatfor multi-app supportffmpegon PATH for non-AMR audio files (logged warning if missing)Test plan