fix(wecom): handle AI Bot file/image messages with AES decrypt and fallback - #23564
Open
kissdge wants to merge 1 commit into
Open
fix(wecom): handle AI Bot file/image messages with AES decrypt and fallback#23564kissdge wants to merge 1 commit into
kissdge wants to merge 1 commit into
Conversation
…llback - Inject placeholder text for file messages without text body - Fix AES key base64 padding (43 chars without =) - Switch from AES-256-OFB to AES-256-CBC with PKCS#7 padding - Add response_url POST fallback when AES decryption fails - Support image_keys via aibot_get_msg_media API - Support media_id direct download via aibot/media/get API - Save debug data on decryption failure for offline analysis - Add comprehensive debug logging throughout media pipeline
Collaborator
Contributor
|
Thanks for investigating the WeCom AI Bot media path. The empty-message guard remains relevant, but this needs a targeted port and corrections before it can be salvaged. Problems
Suggested changes
Automated hermes-sweeper review. |
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.
Problem
WeCom AI Bot file/image messages were being silently dropped by Hermes Agent due to multiple bugs in
gateway/platforms/wecom.py:textbody → skipped byif not text and not media_urls: return=, causingb64decodefailureNoneimage_keysnot recognized → WeCom AI Bot specific image delivery mechanism ignoredmedia_idnot supported → direct media download via API not implementedFixes
[收到文件消息]when file msg has no text body=padding for 43-char base64 keysaibot_get_msg_mediaAPIaibot/media/getAPITesting
Files Changed
gateway/platforms/wecom.py(+229 / -18 lines)References
fix(wecom): handle AI Bot file messages with empty sender_id and AES decryptfix(wecom): support aibot image pic_url and multiple AES key formats