fix(provider): prevent Bedrock from prefixing ARN and deepseek.v3.2 model IDs#18948
Open
kevinWangSheng wants to merge 1 commit intoanomalyco:devfrom
Open
fix(provider): prevent Bedrock from prefixing ARN and deepseek.v3.2 model IDs#18948kevinWangSheng wants to merge 1 commit intoanomalyco:devfrom
kevinWangSheng wants to merge 1 commit intoanomalyco:devfrom
Conversation
…odel IDs Two issues in the Bedrock model ID transformation: 1. ARN-format model IDs (arn:aws:bedrock:...) were incorrectly prefixed with region codes (e.g. us.arn:aws:bedrock:...), making them invalid. Add a guard to pass ARNs through unchanged. 2. The broad "deepseek" match in the US cross-region prefix list incorrectly prefixed deepseek.v3.2 with "us.", but this model has no cross-region inference profile. Narrow the match to "deepseek-r1" which does support cross-region inference. Fixes anomalyco#18812
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #18812
Type of change
What does this PR do?
Fixes two issues in the Amazon Bedrock model ID transformation logic (
provider.tsgetModel()):ARN guard — Foundation-model ARN IDs (
arn:aws:bedrock:us-east-1::foundation-model/deepseek.v3.2) were incorrectly prefixed with region codes (e.g.us.arn:aws:bedrock:...), making them invalid. Added a guard to pass ARN-format model IDs through unchanged.DeepSeek prefix narrowing — The broad
"deepseek"match in the US cross-region prefix list incorrectly prefixeddeepseek.v3.2withus., but this model has no cross-region inference profile. Narrowed the match to"deepseek-r1"which does support cross-region inference.Before this fix:
deepseek.v3.2→us.deepseek.v3.2→ValidationException: The provided model identifier is invalid.arn:aws:bedrock:...→us.arn:aws:bedrock:...→ same errorAfter this fix:
deepseek.v3.2→ passed through unchanged → worksarn:aws:bedrock:...→ passed through unchanged → worksdeepseek-r1-v1:0→us.deepseek-r1-v1:0→ still gets cross-region prefix correctlyHow did you verify your code works?
packages/opencode/test/provider/amazon-bedrock.test.tsstill passdeepseek.v3.2works without prefix and fails withus.prefixScreenshots / recordings
N/A — provider model ID transformation change
Checklist