Skip to content

Fix Bedrock inference-profile prefix for AWS GovCloud#3

Merged
wch merged 1 commit into
mainfrom
fix-govcloud-inference-profile-prefix
Jul 8, 2026
Merged

Fix Bedrock inference-profile prefix for AWS GovCloud#3
wch merged 1 commit into
mainfrom
fix-govcloud-inference-profile-prefix

Conversation

@sharon-wang

@sharon-wang sharon-wang commented Jul 8, 2026

Copy link
Copy Markdown
Member

What

getInferenceProfilePrefix matched any region starting with us- to the commercial us. prefix. GovCloud regions (us-gov-west-1, us-gov-east-1) also start with us-, so discovered Bedrock models came out as us.anthropic.claude-... — a commercial inference profile that doesn't exist in GovCloud, so the runtime call failed with a ValidationException / model-not-found.

Adds a us-gov- case ahead of the general us- check so GovCloud regions map to the us-gov partition.

Closes posit-dev/assistant#1751

Changes

  • getInferenceProfilePrefix (src/providers/bedrock-provider.ts): us-gov- case before the us- check; exported for testing.
  • New unit tests: GovCloud regions → us-gov, plus the existing commercial/eu/apac cases as an ordering regression guard.

Notes

  • The model ID passes straight through from discovery to the runtime call, so no BedrockClient change is needed once the prefix is right.
  • Endpoints are already GovCloud-correct: @ai-sdk/amazon-bedrock derives bedrock-runtime.us-gov-west-1.amazonaws.com from the region.

Out of scope

The us-east-1 default with no AWS_REGION env fallback on the Positron catalog-adapter path, and the lack of a model-ID override in the Bedrock auth modal.

getInferenceProfilePrefix matched any region starting with "us-" to the
commercial "us." prefix. GovCloud regions (us-gov-west-1, us-gov-east-1)
also start with "us-", so their discovered models came out as
us.anthropic.claude-... — a commercial inference profile that doesn't
exist in GovCloud, causing the runtime call to fail with a
ValidationException / model-not-found.

Add a us-gov- case ahead of the general us- check so GovCloud regions map
to the "us-gov" partition. Export the helper and add unit tests covering
the GovCloud regions plus the existing commercial/eu/apac cases as an
ordering regression guard.
@sharon-wang
sharon-wang force-pushed the fix-govcloud-inference-profile-prefix branch from 6e05d98 to 63d1969 Compare July 8, 2026 14:58
@sharon-wang
sharon-wang requested a review from wch July 8, 2026 14:59
@wch
wch merged commit 493a0f5 into main Jul 8, 2026
1 check passed
@wch
wch deleted the fix-govcloud-inference-profile-prefix branch July 8, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants