GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(provider): prevent Bedrock from prefixing ARN and deepseek.v3.2 model IDs by kevinWangSheng · Pull Request #18948 · anomalyco/opencode

Conversation

@kevinWangSheng

@kevinWangSheng kevinWangSheng commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #18812

Type of change

  • Bug fix

What does this PR do?

Fixes two issues in the Amazon Bedrock model ID transformation logic (provider.ts getModel()):

  1. 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.

  2. DeepSeek prefix narrowing — 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. 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 error

After this fix:

  • deepseek.v3.2 → passed through unchanged → works
  • arn:aws:bedrock:... → passed through unchanged → works
  • deepseek-r1-v1:0 → us.deepseek-r1-v1:0 → still gets cross-region prefix correctly

How did you verify your code works?

  • Typecheck passes (all packages)
  • Existing Bedrock tests in packages/opencode/test/provider/amazon-bedrock.test.ts still pass
  • The reporter verified via AWS CLI that deepseek.v3.2 works without prefix and fails with us. prefix
  • ARN-format model IDs are a standard AWS pattern that should never be modified

Screenshots / recordings

N/A — provider model ID transformation change

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

charlesreid1, Raiszo, and brandon-bt reacted with thumbs up emoji
All reactions
  • 👍 3 reactions
@kevinWangSheng
fix(provider): prevent Bedrock from prefixing ARN and deepseek.v3.2 m…
d3e174e
…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
@github-actions github-actions Bot added the contributor label Mar 24, 2026
@KissingerGPT KissingerGPT mentioned this pull request Mar 24, 2026
Amazon Bedrock rewrites deepseek.v3.2 and foundation-model ARNs to invalid us.* model IDs Kilo-Org/kilocode#7548
Closed
@KissingerGPT

KissingerGPT commented Apr 1, 2026

Copy link
Copy Markdown

I applied this to a fresh build and it resolved my issues.

charlesreid1, charlesbullsd, and Sabo-kun reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@opencode-agent
opencode-agent Bot force-pushed the dev branch from 2f2ed11 to 9f201d6 Compare April 16, 2026 21:55
@github-actions github-actions Bot mentioned this pull request Jun 16, 2026
Donta/model fix #32595
Closed
@github-actions github-actions Bot mentioned this pull request Jun 29, 2026
fix: preserve Bedrock DeepSeek model ids #34441
Merged
3 of 6 tasks
@marc-jan

marc-jan commented Aug 1, 2026

Copy link
Copy Markdown

Would be great if this can be merged.

Sabo-kun reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Sabo-kun

Sabo-kun commented Aug 10, 2026

Copy link
Copy Markdown

Would be great if this can be merged.

I agree, please release the fix as soon as possibile! :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Sep 14, 2026
fix(core): apply us-gov prefix for Bedrock models in GovCloud regions #49055
Closed
3 of 6 tasks
@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thdxr thdxr closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Amazon Bedrock rewrites deepseek.v3.2 and foundation-model ARNs to invalid us.* model IDs

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@kevinWangSheng @KissingerGPT @marc-jan @Sabo-kun @thdxr
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.