Skip to content

Discover Bedrock inference profiles across AWS regions - #49

Merged
wch merged 2 commits into
mainfrom
feat/bedrock-inference-profile-discovery
Aug 7, 2026
Merged

Discover Bedrock inference profiles across AWS regions#49
wch merged 2 commits into
mainfrom
feat/bedrock-inference-profile-discovery

Conversation

@wch

@wch wch commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Discover invokable Amazon Bedrock model IDs with ListInferenceProfiles instead 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-1 default out of resolved provider connections so stored user regions retain precedence.

Changes

  • Discover and paginate active system-defined inference profiles, select IDs deterministically, and contain permission or service failures within discovery.
  • Join inference profiles to foundation models, treating successful discovery as authoritative and using prefix construction only as a fallback in legacy region families.
  • Apply the built-in us-east-1 default at credential synthesis instead of catalog resolution.
  • Add regression coverage for default precedence, fallback behavior, pagination, error handling, and profile selection.

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-gov regions 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.

wch added 2 commits August 6, 2026 21:54
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.
@wch
wch marked this pull request as ready for review August 7, 2026 19:21
@wch
wch merged commit 2a59f06 into main Aug 7, 2026
4 checks passed
@wch
wch deleted the feat/bedrock-inference-profile-discovery branch August 7, 2026 19:21
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.

1 participant