anomalyco / anomalyco/opencode
Bedrock GPT-6 Astra fails after the read tool returns an image
@rekram1-node is already working on this.
Since Sep 9, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Reading an image with amazon-bedrock/global.openai.gpt-6-astra fails on the next model request:
undefined: This model doesn't support the image field for user messages. Remove image and try again.
The response is HTTP 400 from Bedrock ConverseStream. Retrying the conversation keeps failing because the image remains in the tool history.
Direct AWS SDK tests with the same model, region (us-east-2), and synthetic PNG isolate the problem: a user-level image succeeds, an image inside toolResult.content fails, and moving it beside the tool result succeeds. Astra supports images; it rejects this placement.
supportsMediaInToolResult() currently assumes all Bedrock models accept tool-result images. A local plugin that hoists Astra's tool images fixes both reading new images and resuming the failed conversation. Running the same OpenCode test with --pure reproduces the error.
Plugins
Reproduced with --pure (external plugins disabled).
OpenCode version
1.18.29
Steps to reproduce
- Configure Amazon Bedrock in
us-east-2with access toglobal.openai.gpt-6-astra. - Run
opencode run --pure -m amazon-bedrock/global.openai.gpt-6-astra "Use the read tool to open /absolute/path/to/image.png and describe it." - The read tool completes, but the next model request fails with the error above.
Operating System
Linux
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.