You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bedrock: tool-result images rejected for all non-Anthropic/Nova models #49443
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.
#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:
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.
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".
Activity