fix: 修复图片附件文件路径未传递给模型导致 skill 引用路径错误#250
Merged
btc69m979y-dotcom merged 1 commit intomainfrom Mar 4, 2026
Merged
Conversation
图片附件作为 base64 发送给视觉模型时,原始文件路径被排除在 prompt 文本之外, 导致模型在使用 seedream/seedance 等需要 --image 参数的 skill 时无法获知真实路径, 只能凭空猜测一个错误的文件路径。 现在将所有具有真实文件路径的附件(包括图片)都包含在 prompt 文本中, 使模型既能通过 base64 看到图片内容,也能通过文本知道文件的实际位置。
This was referenced Mar 5, 2026
mammut001
pushed a commit
to mammut001/LobsterAI
that referenced
this pull request
Mar 11, 2026
…image-attachment-path fix: 修复图片附件文件路径未传递给模型导致 skill 引用路径错误
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
修复 cowork 中图片附件与 skill(如 seedream/seedance)配合使用时,模型无法获知图片真实文件路径的问题。
问题
此前为支持视觉模型,图片附件被单独处理为 base64 内容块直接传递给模型,但在构建 prompt 文本时,图片的原始文件路径被排除在外(仅保留了非图片附件的路径)。
这导致模型在调用需要
--image <path>参数的 skill 时,因不知道文件实际位置而凭空猜测路径,例如:C:\Users\xxx\Desktop\photo.jpgD:/cus_sk/1000035689.jpg修复
将
attachmentLines的数据源从fileAttachments(仅非图片附件)改为attachments(所有附件),使图片附件的文件路径也包含在 prompt 文本中。修改后模型同时获得:输入文件: <path>(新增)剪贴板粘贴的图片(pseudo-path 以
inline:开头)不受影响,仍被正确过滤。