Skip to content

Improper processing of a Bedrock error message causes failures. #13040

Closed

Description

@jeblackburn

Description

I'm using an internal OpenAI-compliant gateway to reach Bedrock, to access Opus 4.5. I got the following error message asking the model to do some fairly involved code transformations.

AI_TypeValidationError: Type validation failed: Value: {"id":"4ec75945-9e25-47e0-9c6f-81f7d91a32fb","error":"Error occured during streaming: 'us.anthropic.claude-opus-4-5-20251101-v1:0-cac-cr'"}.

Error message: [{"code":"invalid_union","errors":[[{"expected":"array","code":"invalid_type","path":["choices"],"message":"Invalid input: expected array, received undefined"}],[{"expected":"object","code":"invalid_type","path":["error"],"message":"Invalid input: expected object, received string"}]],"path":[],"message":"Invalid input"}] 

As I understand it, this is probably an underlying error message returned by Bedrock, which is not being processed correctly by the Bedrock provider (demanding a JSON object, not tolerating a string under the "error" key.)

Plugins

None

OpenCode version

Locally built, pulled from GH a week ago.

Steps to reproduce

  1. Configure a local gateway to point at Bedrock.
  2. Specify the Opus 4.5 model.
  3. Ask to do a lot of simple transformations on a lot of fairly simple classes.

I know, not terribly helpful. Best I can do.

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Apr 12, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions