Discover Bedrock inference profiles across AWS regions - #49
Merged
Conversation
BEDROCK_DEFAULTS (us-east-1) is no longer layered into the resolved connection via PROVIDER_CONNECTION_DEFAULTS: the baked-in default outranked the user's stored credential region downstream, so every non-us-east-1 region choice was silently ignored (posit-dev/assistant#2002). The BEDROCK_DEFAULTS export remains for consumers to apply later — @credential synthesis in @assistant/node (gated on the built-in bedrock provider id) and the standalone configuration dialog's initial value.
Stop guessing cross-region inference profile IDs from the region's name family. getConverseModels() now runs ListInferenceProfiles discovery in parallel with ListFoundationModels and treats a successful listing as authoritative for the region: invokable IDs come from the discovered profile map, and FM models absent from it are skipped rather than prefix-guessed (a fabricated ID fails at invoke time). Prefix construction survives only as the discovery-unavailable fallback, and only for the four handled families — getInferenceProfilePrefix() now returns null for unknown families instead of silently defaulting to us, so ca-/sa-/me-/af-/il- regions get correct IDs from discovery and an empty list (with a log naming bedrock:ListInferenceProfiles) instead of broken us.* IDs when discovery is denied. Discovery lives in a new bedrock-inference-profiles module with a narrow sender interface, a documented total order for duplicate profiles (legacy-prefix match, then other geo alphabetically, then global.*) so response order can't flip IDs across cache refreshes, and a contained error boundary: AccessDenied logs at debug naming the IAM action, other failures log at warn, and provider auth status is never touched — a discovery 403 is a degradation, not an auth failure. Follow-up to posit-dev/assistant#2002.
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.
Discover invokable Amazon Bedrock model IDs with
ListInferenceProfilesinstead of deriving them from region-name prefixes. This lets consumers list correct models in Canada, the Middle East, Africa, South America, and future AWS regions while preserving the legacy fallback when profile discovery is unavailable.The PR also moves Bedrock's
us-east-1default out of resolved provider connections so stored user regions retain precedence.Changes
us-east-1default at credential synthesis instead of catalog resolution.Design decisions
A successful profile listing is the source of truth for the calling region; missing models are skipped rather than assigned guessed IDs. When discovery is denied or fails, existing
us/eu/apac/us-govregions retain prefix-based behavior, while other region families return no guessed Converse models.Not included
Live validation in a newly supported AWS region requires suitable Bedrock credentials and remains to be completed in the consuming Assistant PR.
Supports posit-dev/assistant#2002.