From c168466dbd941ca4fcd8a84be07a0332c983701e Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Wed, 15 Oct 2025 12:58:22 -0500 Subject: [PATCH] fix: Text content blocks must contain non-whitespace text --- packages/opencode/src/session/message-v2.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/opencode/src/session/message-v2.ts b/packages/opencode/src/session/message-v2.ts index 8dc059ca1..81b4158db 100644 --- a/packages/opencode/src/session/message-v2.ts +++ b/packages/opencode/src/session/message-v2.ts @@ -513,6 +513,8 @@ export namespace MessageV2 { } if (msg.info.role === "assistant") { + const hasEmptyTextPart = msg.parts.some((part) => part.type === "text" && part.text.trim() === "") + if (hasEmptyTextPart) continue result.push({ id: msg.info.id, role: "assistant",