Skip to content

Conversation

@cerashdan
Copy link

Description

Creating a Strands agent with default parameters (default model ID) causes the agent creation to fail in non-US region like eu-central-1 or ap-south-1 due to hardcoded model identitfer DEFAULT_BEDROCK_MODEL_ID = "us.anthropic.claude-sonnet-4-20250514-v1:0" which only works in US based regions.

The current problems is that model selection happens before region resolution. This PR changes this order such that model selection depends on region resolution first, followed by getting the regional cross-region inference model id for the AWS partition where the agent is created (e.g. apac.anthropic.claude-sonnet-4-20250514-v1:0 or eu.anthropic.claude-sonnet-4-20250514-v1:0)

We dynamically resolve the inference profile ID for the resolved region allowing this fix to work in future regions without modification.

Test suite has been updated to cater for these new changes.

Related Issues

#732

Documentation PR

N/A

Type of Change

Bug fix

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dbschmigelski
Copy link
Member

Hi, we went on a slightly different path to avoid the cost of a call at runtime. This does mean we incur the cost of requiring future changes in the event the prefix of the region does not match, like for apac and the ap in ap-south-1. But, we felt that was acceptable.

The PR which was merged and released in 1.8.0 is #835.

Apologies that your PR will not be merged. We greatly appreciate the contribution and certainly welcome future contributions!

Thanks

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.

2 participants