GeezerVison is showing github.com — fix(opencode): hoist Bedrock tool images except Claude, Nova, and Lla… · dmouse/opencode@c101347
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/opencode/src/session
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/session/message-v2.ts +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -148,7 +148,11 @@ export const toModelMessagesEffect = Effect.fnUntraced(function* ( |
148 | 148 | if (model.api.npm === "@ai-sdk/anthropic") return true |
149 | 149 | if (model.api.npm === "@ai-sdk/openai") return true |
150 | 150 | 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 | + } |
152 | 156 | if (model.api.npm === "@ai-sdk/xai") return attachment.mime.startsWith("image/") |
153 | 157 | if (model.api.npm === "@ai-sdk/google-vertex/anthropic") return true |
154 | 158 | if (model.api.npm === "@ai-sdk/google") { |
|