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

Open
opened 2026-02-16 18:11:24 -05:00 by yindo · 0 comments
Owner

Originally created by @jeblackburn on GitHub (Feb 10, 2026).

Originally assigned to: @thdxr on GitHub.

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

Originally created by @jeblackburn on GitHub (Feb 10, 2026). Originally assigned to: @thdxr on GitHub. ### 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_
yindo added the bug label 2026-02-16 18:11:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9017