Skip to content

修复粘贴图片无法被 Agent 读取的问题#47

Merged
freestylefly merged 1 commit into
freestylefly:mainfrom
feifei210134258:codex/fix-pasted-image-attachments-pr
Jun 15, 2026
Merged

修复粘贴图片无法被 Agent 读取的问题#47
freestylefly merged 1 commit into
freestylefly:mainfrom
feifei210134258:codex/fix-pasted-image-attachments-pr

Conversation

@feifei210134258

Copy link
Copy Markdown
Contributor

背景

在任务会话中直接粘贴图片时,图片会以 inline: 附件形式保存在输入状态里。提交任务时这类伪路径会被过滤掉,导致 Agent 的工具侧拿不到真实可读的图片文件路径;而用户把图片先放进项目文件夹后,由于附件拥有真实路径,Agent 可以正常读取和使用。

修改内容

  • 对剪贴板或浏览器拖入、没有本机路径的图片,先通过已有的 saveInlineFile 流程暂存为真实文件。
  • 将暂存后的真实路径作为图片附件加入输入附件列表,同时保留 dataUrl,确保视觉模型仍可接收图片内容。
  • 为没有文件名的粘贴图片补充默认名称,避免生成空的 inline: 附件名。

验证

  • npm run build
  • npm run lint(通过;仓库现有 warning 仍存在)

@freestylefly freestylefly merged commit d455a8e into freestylefly:main Jun 15, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants