Description
Bedrock Converse rejects images inside toolResult for most non-Anthropic models, but OpenCode keeps tool-result images in place for every @ai-sdk/amazon-bedrock model. After any tool returns an image (read on a PNG, a screenshot MCP tool), every following request in the session fails with:
This model doesn't support the image field for user messages. Remove image and try again.
This is documented AWS behavior, not a model quirk. The Converse API reference for ToolResultContentBlock.image says: "This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models."
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolResultContentBlock.html
#48069 reports this for GPT-6 Astra and #48070 fixes Astra by model ID. The problem is wider. I ran the same 4x4 PNG through bedrock-runtime converse in us-east-1, once as a user-level image block and once inside toolResult.content:
| Model |
User-level image |
Image in toolResult |
| anthropic.claude-sonnet-4-6, claude-opus-4-8 |
200 |
200 |
| amazon.nova-pro-v1:0, nova-2-lite-v1:0 |
200 |
200 |
| meta.llama4-maverick-17b-instruct-v1:0 |
200 |
200 (not on the documented list) |
| openai.gpt-6-astra, gpt-5.6-sol, gpt-5.6-luna, gpt-5.6-terra |
200 |
400 |
| mistral.pixtral-large-2502-v1:0, mistral-large-3-675b-instruct |
200 |
400 |
| qwen.qwen3-vl-235b-a22b |
200 |
400 |
| google.gemma-3-27b-it |
200 |
400 |
| moonshotai.kimi-k2.5 |
200 |
400 |
| xai.grok-4.6 |
500 |
400 |
supportsMediaInToolResult in packages/opencode/src/session/message-v2.ts returns true for images on any @ai-sdk/amazon-bedrock model. The existing hoist path (move the image into a synthetic user message after the tool result) works on every model in the table, so the safe default is to hoist and only keep images in the tool result for the documented Anthropic and Nova IDs.
Plugins
Reproduced with --pure.
OpenCode version
1.18.31, and dev at 88c6c7a.
Steps to reproduce
- Configure Amazon Bedrock with any non-Anthropic image model, e.g.
global.openai.gpt-5.6-sol or us.mistral.pixtral-large-2502-v1:0.
opencode run --pure --model amazon-bedrock/global.openai.gpt-5.6-sol "Use the read tool on ./red.png, then answer with the dominant color in one word."
- The read tool completes; the next model request fails with the error above. The same command against
amazon-bedrock/us.anthropic.claude-sonnet-4-6 answers "Red".
Screenshot and/or share link
No response
Operating System
macOS 15
Terminal
Ghostty
Description
Bedrock Converse rejects images inside
toolResultfor most non-Anthropic models, but OpenCode keeps tool-result images in place for every@ai-sdk/amazon-bedrockmodel. After any tool returns an image (readon a PNG, a screenshot MCP tool), every following request in the session fails with:This is documented AWS behavior, not a model quirk. The Converse API reference for
ToolResultContentBlock.imagesays: "This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models."https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolResultContentBlock.html
#48069 reports this for GPT-6 Astra and #48070 fixes Astra by model ID. The problem is wider. I ran the same 4x4 PNG through
bedrock-runtime conversein us-east-1, once as a user-levelimageblock and once insidetoolResult.content:toolResultsupportsMediaInToolResultinpackages/opencode/src/session/message-v2.tsreturnstruefor images on any@ai-sdk/amazon-bedrockmodel. The existing hoist path (move the image into a synthetic user message after the tool result) works on every model in the table, so the safe default is to hoist and only keep images in the tool result for the documented Anthropic and Nova IDs.Plugins
Reproduced with
--pure.OpenCode version
1.18.31, and
devat 88c6c7a.Steps to reproduce
global.openai.gpt-5.6-solorus.mistral.pixtral-large-2502-v1:0.opencode run --pure --model amazon-bedrock/global.openai.gpt-5.6-sol "Use the read tool on ./red.png, then answer with the dominant color in one word."amazon-bedrock/us.anthropic.claude-sonnet-4-6answers "Red".Screenshot and/or share link
No response
Operating System
macOS 15
Terminal
Ghostty