fix: fix issue if tool returned image and empty text and it caused api errors (#25241)

This commit is contained in:
Aiden Cline 2026-05-01 00:13:03 -05:00 committed by GitHub
commit 563177c6ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -772,7 +772,7 @@ export const toModelMessagesEffect = Effect.fnUntraced(function* (
return {
type: "content",
value: [
{ type: "text", text: outputObject.text },
...(outputObject.text ? [{ type: "text", text: outputObject.text }] : []),
...attachments.map((attachment) => ({
type: "media",
mediaType: attachment.mime,