Skip to content

Fix Weixin media uploads#10342

Closed
xiayh0107 wants to merge 1 commit into
NousResearch:mainfrom
xiayh0107:pr-fix-weixin-media-uploads
Closed

Fix Weixin media uploads#10342
xiayh0107 wants to merge 1 commit into
NousResearch:mainfrom
xiayh0107:pr-fix-weixin-media-uploads

Conversation

@xiayh0107

Copy link
Copy Markdown

Summary

  • align Weixin media send helpers with the gateway call signature used by native media routing
  • preserve the upstream CDN upload fix and verify AES key encoding expected by iLink media payloads
  • add outbound media tests covering keyword arguments and upload_full_url behavior

Testing

  • source venv/bin/activate && python -m pytest tests/gateway/test_weixin.py -q

Copilot AI review requested due to automatic review settings April 15, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Weixin adapter’s outbound media helpers to match the shared gateway adapter method signatures and fixes/locks in correct iLink media upload behavior (CDN upload method + AES key encoding), with regression tests to prevent re-breakage.

Changes:

  • Align WeixinAdapter.send_image_file and send_document signatures with the base adapter contract (keyword-friendly parameters and **kwargs).
  • Ensure outbound media upload uses POST for upload_full_url and that iLink payload aes_key is encoded as base64(hex_string).
  • Add tests covering keyword argument support, upload_full_url POST behavior, and AES key encoding in the outbound media payload.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
gateway/platforms/weixin.py Updates outbound media method signatures and enforces correct CDN upload + AES key encoding in iLink payloads.
tests/gateway/test_weixin.py Adds regression tests for Weixin outbound media keyword args and upload/crypto payload behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@teknium1

Copy link
Copy Markdown
Contributor

Merged as part of Batch-5 salvage: #11634

Your commit cherry-picked onto main with authorship preserved. Much of the original PR scope (send_image_file parameter rename, MEDIA extraction, voice fallback, markdown preservation) was already landed via Batches 1/3 salvages. What survived here is valuable too: the send_document() base-class signature alignment (adds file_name, reply_to, **kwargs) and your upload_full_url POST + hex-encoded AES key regression test. Had to update Batch-1's earlier regression tests to match your new keyword-arg send_document(chat_id=...) call pattern. Thanks!

Commit SHA on main: 8dcd08d

@teknium1 teknium1 closed this Apr 17, 2026
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.

4 participants