fix(core): resolve Bedrock AWS profile credentials for V2 - #43681
fix(core): resolve Bedrock AWS profile credentials for V2#43681acorpstein wants to merge 2 commits into
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate found:
This PR appears to address the exact same issue—resolving Bedrock credentials from the AWS default credential chain. The current PR #43681 may be a reopened/updated fix for the same problem or a related follow-up. Related PRs (likely context or dependencies):
|
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
@rekram1-node - This should fix a major bedrock issue in v2 I see that you're removing ai-sdk - so if this conflicts with that effort let me know and I can possibly do another patch to help you out + help out with testing. |
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
interesting ill have to look over this ty |
|
yeah ik bedrock is rlly broken rn for this case have a few provider things to go over idally this can all be done via a plugin but rn the hooks arent there for it. |
|
@rekram1-node yeah np, i think that might be a bit better to use a plugin approach. -- since this probably won't be merged as is, I can try taking a stab at setting up the plugin hooks and post another update here? worth it? or are things moving too fast? |
|
@rekram1-node I took a pass at the plugin approach you suggested. I added two generic provider hooks to both the Effect and Promise plugin APIs:
Bedrock now owns its AWS behavior entirely inside AmazonBedrockPlugin. The plugin:
Basically retry logic is as follows for bedrock specifically:
|
|
Yeah taking stabs is welcome ill go over it |
Overall: strong change — the V2 hook design, precedence rules (bearer/API key > explicit credentials > AWS chain), and the new tests (late-profile recovery, region-template preservation, never-project-SigV4-as-bearer) are well thought out. Items 3–5 are the ones I'd address before merge. Thanks! |
Hi I'm from Amazon One Medical, we use Bedrock for everything and was trying out V2 branch and decided to create a patch - I've been using this exact patch locally for about 1.5 weeks and haven't had any issues.
Issue for this PR
Closes #40663
Type of change
What does this PR do?
V2 maps Amazon Bedrock models to the native provider before the legacy AI SDK credential hook runs. As a result, configured AWS profiles were detected but their credentials never reached the native SigV4 signer. Some AWS environment values, such as
AWS_REGION, could also be mistaken for bearer credentials.This change:
How did you verify your code works?
bun run build --single.Screenshots / recordings
N/A, this change has no UI behavior.
Checklist