Просмотр исходного кода

fix: Text content blocks must contain non-whitespace text (#3194)

Aiden Cline 4 месяцев назад
Родитель
Сommit
b2ff4be4c6
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      packages/opencode/src/session/message-v2.ts

+ 2 - 0
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",