zai-org / zai-org/feedback

[建议 / Feature] 微信 Bot 支持图片/文件双向传输和可靠的大文件处理

Open
#398 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: 功能建议
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复提议 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

对话 / Agent 交互 · Agent chat / interaction

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

使用场景 · Use case

目前 ZCode 3.9.2 内置微信 Bot 的媒体能力仍然是单向的:

  • 微信 → ZCode:可以接收图片和普通文件,但每条消息只处理前 4 个附件,单个附件超过 5 MiB 会被拒绝。
  • ZCode → 微信:Agent/电脑端目前只能回传文本。即使任务已经生成图片、PDF、表格、压缩包或其他本地文件,微信端也只能收到文字说明或路径,收不到真正的图片/文件附件。

典型使用场景是在手机微信中远程交给 ZCode 一个任务,例如生成报表、整理文档、制作截图或打包项目。任务完成后,用户希望直接在原微信会话中收到产物。目前必须重新回到电脑上查找并手工通过微信发送,远程工作流无法闭环。

复现当前行为:

  1. 在 ZCode 中创建并绑定内置微信 Bot。
  2. 从微信向 Bot 发送一张小图片或一个小文件,ZCode 可以接收。
  3. 让 Agent 生成一个本地图片或普通文件,并要求发送回当前微信。
  4. 微信端只收到文字回复,没有收到图片或文件附件。

对于超过 5 MiB 的入站附件,当前也无法作为大文件工作流使用。

建议方案 · Proposal

希望 ZCode 内置微信 Bot 正式支持图片和普通文件的双向传输,并完善大文件可靠性:

  1. Agent/ZCode → 微信

    • 支持把 Agent 生成或用户明确指定的本地图片作为微信图片消息发送。
    • 支持把 PDF、Office 文档、文本、压缩包等作为微信文件附件发送。
    • 文本、图片和文件混合回复时保持原始顺序,并继续使用原会话的 context token。
  2. 微信 → ZCode

    • 提升或取消当前单个附件 5 MiB 的固定限制,尽量与微信/iLink 服务端真实上限对齐。
    • 明确记录并展示支持的单文件大小、单次附件数量和媒体类型限制。
  3. 大文件传输可靠性

    • 下载、哈希、AES-128-ECB 加解密和上传采用流式处理,避免把完整大文件及 Base64 副本同时放入内存。
    • 提供分类型超时、有限重试、取消、临时文件清理和清晰的用户错误提示。
    • 单个附件失败时说明具体是哪一项失败,并允许后续合法附件继续处理。
    • 防止重试或恢复流程造成附件重复发送。

腾讯公开的微信 iLink 参考协议已经提供 sendmessage 的图片/文件消息类型以及 getuploadurl CDN 上传流程,希望 ZCode 内置微信 Bot 能正式接入并提供稳定的产品级实现。

预期价值 · Expected value

实现后,用户可以完全通过手机微信完成“提交任务 → ZCode 处理 → 收到最终文件”的闭环,不必回到电脑手工寻找和转发产物。

这会直接改善远程办公、报表导出、文档生成、图片处理、日志打包和项目归档等高频场景;同时,流式传输和明确限制能够避免大文件导致内存峰值、无响应或不透明失败。

你认为的优先级 · Your perceived priority

高 · High

你使用的 ZCode 版本 / 环境 · ZCode version / environment

ZCode 3.9.2.6069 / Windows x64 / 内置微信 Bot

补充材料 · Additional context

腾讯微信 iLink 开源参考:

本建议只针对 ZCode 官方内置微信 Bot 的产品能力。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no ZCode source files, tests, or implementation entry points. Start by reviewing the referenced openclaw-weixin send-media.ts and upload.ts examples, then locate the built-in WeChat Bot code in the ZCode repository. Done should cover bidirectional image/file transfer, documented limits, and reliable large-file handling without duplicate sends.

Written by the indexing model from the issue text.

Assessment

Domain
backend-api-design, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.