Skip to content

Commit 563177c

Browse files
authored
fix: fix issue if tool returned image and empty text and it caused api errors (#25241)
1 parent 4eae8ec commit 563177c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ export const toModelMessagesEffect = Effect.fnUntraced(function* (
772772
return {
773773
type: "content",
774774
value: [
775-
{ type: "text", text: outputObject.text },
775+
...(outputObject.text ? [{ type: "text", text: outputObject.text }] : []),
776776
...attachments.map((attachment) => ({
777777
type: "media",
778778
mediaType: attachment.mime,

0 commit comments

Comments
 (0)