-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Weixin channel bot 发送图片后微信端显示灰色占位 #3993
Copy link
Copy link
Closed
Labels
category/integrationExternal integrationsExternal integrationspriority/P2Medium - Moderately impactful, noticeable problemMedium - Moderately impactful, noticeable problemstatus/needs-triageIssue needs to be triaged and labeledIssue needs to be triaged and labeledtype/bugSomething isn't working as expectedSomething isn't working as expected
Metadata
Metadata
Assignees
Labels
category/integrationExternal integrationsExternal integrationspriority/P2Medium - Moderately impactful, noticeable problemMedium - Moderately impactful, noticeable problemstatus/needs-triageIssue needs to be triaged and labeledIssue needs to be triaged and labeledtype/bugSomething isn't working as expectedSomething isn't working as expected
Type
Fields
Give feedbackNo fields configured for issues without a type.
What happened? / 问题描述
Weixin channel bot 发送图片时,微信端图片不能正常显示,只看到灰色图片占位。
根据脱敏日志,复现过程如下:
启动 Weixin channel bot。
用户要求 bot 发送图片。
bot 按 Weixin channel 的图片发送约定输出:
[IMAGE: <IMAGE_PATH>]日志中确认
<IMAGE_PATH>对应文件存在,且是有效 PNG 图片,大小约 37KB,分辨率为 1200 x 900。微信端收到消息后,图片显示为灰色占位,无法看到实际图片内容。
bot 再次发送同一张图片后,微信端仍然显示灰色占位。
文本日志中没有看到
Failed to send image、getuploadurl failed、CDN upload failed或sendMessage failed之类的 Weixin 图片发送失败日志。What did you expect to happen? / 期望行为
Weixin channel bot 通过
[IMAGE: /absolute/path/to/file.png]发送本地图片时,微信端应该能正常显示图片内容,而不是灰色占位。从当前实现看,Weixin channel 会在默认指令中声明
[IMAGE: ...]图片发送能力;WeixinChannel.sendMessage()会解析该标记并调用sendImage(),后者执行本地图片校验、CDN 上传,并通过image_item发送图片消息。因此图片文件有效且发送流程未显式报错时,微信客户端应能渲染该图片。Client information / 客户端信息
Client Information from logs
Qwen Code version: 0.15.8
Model: qwen3.6-plus
Auth type: openai
Git branch: main
CWD: <PROJECT_DIR>
Session: <SESSION_ID>
Anything else we need to know? / 其他信息
脱敏日志中的关键证据:
[IMAGE: <IMAGE_PATH>]。<IMAGE_PATH>文件存在,并被file识别为有效 PNG:1200 x 900,约 37KB。APIUserAbortError: Request was aborted.出现在用户打断前序请求时,和图片发送失败现象不直接对应。初步相关代码位置:
packages/channels/weixin/src/WeixinAdapter.ts:解析[IMAGE: ...]标记并调用图片发送逻辑。packages/channels/weixin/src/send.ts:执行图片校验、AES 加密、CDN 上传,并发送image_item。packages/channels/weixin/src/api.ts:调用/ilink/bot/getuploadurl和/ilink/bot/sendmessage。建议重点检查 Weixin 出站图片消息的
image_itempayload、CDN 加密参数、图片缩略图/展示所需字段,以及微信端灰色占位但服务端未报错时是否缺少可观测日志。