Aiden Cline 1 mese fa
parent
commit
06acd70670
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      packages/opencode/src/provider/transform.ts

+ 4 - 1
packages/opencode/src/provider/transform.ts

@@ -22,7 +22,10 @@ export namespace ProviderTransform {
     if (model.api.npm === "@ai-sdk/anthropic") {
       msgs = msgs
         .map((msg) => {
-          if (typeof msg.content === "string") return msg
+          if (typeof msg.content === "string") {
+            if (msg.content === "") return undefined
+            return msg
+          }
           if (!Array.isArray(msg.content)) return msg
           const filtered = msg.content.filter((part) => {
             if (part.type === "text" || part.type === "reasoning") {