Fix Bedrock inference-profile prefix for AWS GovCloud#3
Merged
Conversation
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
force-pushed
the
fix-govcloud-inference-profile-prefix
branch
from
July 8, 2026 14:58
6e05d98 to
63d1969
Compare
wch
approved these changes
Jul 8, 2026
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.
What
getInferenceProfilePrefixmatched any region starting withus-to the commercialus.prefix. GovCloud regions (us-gov-west-1,us-gov-east-1) also start withus-, so discovered Bedrock models came out asus.anthropic.claude-...— a commercial inference profile that doesn't exist in GovCloud, so the runtime call failed with aValidationException/ model-not-found.Adds a
us-gov-case ahead of the generalus-check so GovCloud regions map to theus-govpartition.Closes posit-dev/assistant#1751
Changes
getInferenceProfilePrefix(src/providers/bedrock-provider.ts):us-gov-case before theus-check; exported for testing.us-gov, plus the existing commercial/eu/apac cases as an ordering regression guard.Notes
BedrockClientchange is needed once the prefix is right.@ai-sdk/amazon-bedrockderivesbedrock-runtime.us-gov-west-1.amazonaws.comfrom the region.Out of scope
The
us-east-1default with noAWS_REGIONenv fallback on the Positron catalog-adapter path, and the lack of a model-ID override in the Bedrock auth modal.