Uh oh!
There was an error while loading. Please reload this page.
fix(core): resolve Bedrock credentials from the AWS default chain - #40522
Open
rekram1-node wants to merge 1 commit into
Open
fix(core): resolve Bedrock credentials from the AWS default chain#40522rekram1-node wants to merge 1 commit into
rekram1-node wants to merge 1 commit into
Conversation
17 tasks
6 tasks
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 freeto 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.
Summary
Restores AWS default credential chain support (profile,
~/.aws/credentials, SSO, process creds, instance/container roles) for native Bedrock, which was lost when Bedrock routing moved off the AI SDK seam in #40165.Design: the server owns credential resolution; the route stays dumb.
packages/aiis unchanged. Bedrock keeps taking staticcredentialsand never refreshes them, per its documented contract ("the consumer rebuilds the model").callModel→context.load→models.resolve), so credentials captured at model build time are never more than one turn old.ModelResolver.fromCatalogModelnow finalizes Bedrock settings viawithBedrockCredentials:apiKeyor explicitcredentials→ untouchedAWS_BEARER_TOKEN_BEDROCK→ injected asapiKey(bearer)@aws-sdk/credential-providers(already a core dep), honoringsettings.profile/AWS_PROFILEfromNodeProviderChaincaches and refreshes internally, so we don't re-walk SSO/IMDS every turn.AWS_REGIONenv fallback the old AI SDK hook honored.Covers both
amazon-bedrock(Converse SigV4) andamazon-bedrock/mantle(SigV4 or bearer) specifiers.Not in scope: cross-region inference-profile model-ID prefixing (
resolveModelID) — tracked separately.Checks
bun typecheck(packages/core)bun test test/model-resolver.test.ts— 29 pass (chain fallback, bearer precedence, explicit-credentials passthrough)bun test test/generate.test.ts test/aisdk.test.ts test/aisdk-native.test.ts— 22 passRequested by: Aiden Cline (rekram1-node)