Browse Source

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

Aiden Cline 6 months ago
parent
commit
563177c6ac
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/opencode/src/session/message-v2.ts

+ 1 - 1
packages/opencode/src/session/message-v2.ts

@@ -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,