Skip to content

fix: 修复图片附件文件路径未传递给模型导致 skill 引用路径错误#250

Merged
btc69m979y-dotcom merged 1 commit intomainfrom
fix/cowork-image-attachment-path
Mar 4, 2026
Merged

fix: 修复图片附件文件路径未传递给模型导致 skill 引用路径错误#250
btc69m979y-dotcom merged 1 commit intomainfrom
fix/cowork-image-attachment-path

Conversation

@btc69m979y-dotcom
Copy link
Copy Markdown
Collaborator

Summary

修复 cowork 中图片附件与 skill(如 seedream/seedance)配合使用时,模型无法获知图片真实文件路径的问题。

问题

此前为支持视觉模型,图片附件被单独处理为 base64 内容块直接传递给模型,但在构建 prompt 文本时,图片的原始文件路径被排除在外(仅保留了非图片附件的路径)。

这导致模型在调用需要 --image <path> 参数的 skill 时,因不知道文件实际位置而凭空猜测路径,例如:

  • 实际路径:C:\Users\xxx\Desktop\photo.jpg
  • 模型猜测:D:/cus_sk/1000035689.jpg

修复

attachmentLines 的数据源从 fileAttachments(仅非图片附件)改为 attachments(所有附件),使图片附件的文件路径也包含在 prompt 文本中。修改后模型同时获得:

  1. 视觉内容 — 通过 base64 内容块(不变)
  2. 文件路径 — 通过 prompt 中的 输入文件: <path>(新增)

剪贴板粘贴的图片(pseudo-path 以 inline: 开头)不受影响,仍被正确过滤。

图片附件作为 base64 发送给视觉模型时,原始文件路径被排除在 prompt 文本之外,
导致模型在使用 seedream/seedance 等需要 --image 参数的 skill 时无法获知真实路径,
只能凭空猜测一个错误的文件路径。

现在将所有具有真实文件路径的附件(包括图片)都包含在 prompt 文本中,
使模型既能通过 base64 看到图片内容,也能通过文本知道文件的实际位置。
@btc69m979y-dotcom btc69m979y-dotcom merged commit 77af630 into main Mar 4, 2026
@btc69m979y-dotcom btc69m979y-dotcom deleted the fix/cowork-image-attachment-path branch March 4, 2026 07:25
mammut001 pushed a commit to mammut001/LobsterAI that referenced this pull request Mar 11, 2026
…image-attachment-path

fix: 修复图片附件文件路径未传递给模型导致 skill 引用路径错误
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.

1 participant