Skip to content

Commit 55c5ce7

Browse files
gololdf1shclaude
andauthored
fix(analyze): use AI SDK ImagePart format for vision screenshots (#5566)
The analyze plugin used OpenAI's `image_url` format for screenshot attachments, but `generateText()` from the Vercel AI SDK expects the `ImagePart` format (`type: 'image'`). This caused "Invalid prompt: The messages do not match the ModelMessage[] schema" when vision: true. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4461316 commit 55c5ce7

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/plugin/analyze.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,9 @@ const defaultConfig = {
155155
if (config.vision && test.artifacts.screenshot) {
156156
debug('Adding screenshot to prompt')
157157
messages[0].content.push({
158-
type: 'image_url',
159-
image_url: {
160-
url: 'data:image/png;base64,' + base64EncodeFile(test.artifacts.screenshot),
161-
},
158+
type: 'image',
159+
image: base64EncodeFile(test.artifacts.screenshot),
160+
mediaType: 'image/png',
162161
})
163162
}
164163

0 commit comments

Comments
 (0)