Skip to content

fix(bedrock): use boto3 client for AWS region detection#1207

Open
micheallam130 wants to merge 2 commits intoanthropics:mainfrom
micheallam130:main
Open

fix(bedrock): use boto3 client for AWS region detection#1207
micheallam130 wants to merge 2 commits intoanthropics:mainfrom
micheallam130:main

Conversation

@micheallam130
Copy link

Description

Fixes issue #892 - Bedrock client failing to detect AWS region correctly when using AWS_PROFILE.

Changes

  • Use boto3.client("bedrock").meta.region_name instead of boto3.Session().region_name to properly detect AWS region from ~/.aws/config when using AWS_PROFILE
  • Add NoRegionError exception handling as fallback
  • Maintain backward compatibility with the existing fallback to us-east-1

Testing

This fix allows the Bedrock client to correctly detect the AWS region from the user's AWS configuration when using AWS_PROFILE environment variable.

- Use boto3.client('bedrock').meta.region_name instead of
  boto3.Session().region_name to properly detect AWS region
  from ~/.aws/config when using AWS_PROFILE
- Add NoRegionError exception handling as fallback
- Fixes issue anthropics#892
@micheallam130 micheallam130 requested a review from a team as a code owner February 26, 2026 16:07
The deepcopy_minimal function was not properly handling tuples that
contain mutable objects like dicts. When a tuple containing a dict was
passed, the dict inside would be mutated in place.

This fix adds tuple handling to recursively copy contents within tuples.

Fixes issue anthropics#1202
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