anomalyco / anomalyco/opencode

Bedrock GPT-6 Astra fails after the read tool returns an image

Open
#48,069 13 comments 5 reactions 1 assignee View on GitHub

@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
  1. Configure Amazon Bedrock in us-east-2 with access to global.openai.gpt-6-astra.
  2. 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."
  3. The read tool completes, but the next model request fails with the error above.
Operating System

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.