Skip to content

Commit c101347

Browse files
authored
fix(opencode): hoist Bedrock tool images except Claude, Nova, and Llama 4 (anomalyco#50272)
1 parent 0e3dfd1 commit c101347

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ export const toModelMessagesEffect = Effect.fnUntraced(function* (
148148
if (model.api.npm === "@ai-sdk/anthropic") return true
149149
if (model.api.npm === "@ai-sdk/openai") return true
150150
if (model.api.npm === "@ai-sdk/amazon-bedrock/mantle") return true
151-
if (model.api.npm === "@ai-sdk/amazon-bedrock") return attachment.mime.startsWith("image/")
151+
if (model.api.npm === "@ai-sdk/amazon-bedrock") {
152+
if (!attachment.mime.startsWith("image/")) return false
153+
const id = model.api.id.toLowerCase()
154+
return id.includes("anthropic.") || id.includes("nova") || id.includes("llama4") || id.includes("llama-4")
155+
}
152156
if (model.api.npm === "@ai-sdk/xai") return attachment.mime.startsWith("image/")
153157
if (model.api.npm === "@ai-sdk/google-vertex/anthropic") return true
154158
if (model.api.npm === "@ai-sdk/google") {

0 commit comments

Comments
 (0)