Skip to content

Model dropdown hardcodes us. region prefix and ignores Bedrock region configuration #19990

Description

@Poojan-AI

Description:

When using Claude Code with AWS Bedrock in non-US regions (e.g., `ap-south-1`), the model switcher dropdown has several issues that make it unusable:

Issues:

  1. Hardcoded region prefix: When selecting a model from the dropdown (e.g., "Opus 4.5"), the extension writes `us.anthropic.claude-opus-4-5-20251101-v1:0` to `claudeCode.selectedModel`, regardless of the configured AWS region. This causes API errors when using non-US regions that require `global.` prefix.

  2. Incorrect UI display: The dropdown shows "Default (currently Sonnet 4.5)" even when `global.anthropic.claude-opus-4-5-20251101-v1:0` is configured in settings.

  3. Ignores environment variables: The `ANTHROPIC_MODEL` environment variable is set to Opus, but "Default (recommended)" still uses Sonnet.

Environment:

```json
{
"claudeCode.selectedModel": "global.anthropic.claude-opus-4-5-20251101-v1:0",
"claudeCode.environmentVariables": [
{
"name": "CLAUDE_CODE_USE_BEDROCK",
"value": "1"
},
{
"name": "AWS_REGION",
"value": "ap-south-1"
},
{
"name": "ANTHROPIC_MODEL",
"value": "arn:aws:bedrock:ap-south-1:588625695333:inference-profile/global.anthropic.claude-opus-4-5-20251101-v1:0"
}
]
}
```

Steps to Reproduce:

  1. Configure Claude Code to use AWS Bedrock in `ap-south-1` region
  2. Set `claudeCode.selectedModel` to `global.anthropic.claude-opus-4-5-20251101-v1:0`
  3. Click on the model dropdown and select "Opus 4.5"
  4. Settings are changed to `us.anthropic.claude-opus-4-5-20251101-v1:0`
  5. API error occurs: "400 The provided model identifier is invalid"

Expected Behavior:

  • Extension should detect the configured AWS region and use the appropriate inference profile prefix (`global.` for cross-region profiles, `us.` for US regions)
  • Or, provide a setting to configure the region prefix
  • Or, read from environment variables to determine the correct model identifier
  • UI should accurately display which model is currently selected

Workaround:

Manually edit `settings.json` and avoid using the dropdown entirely. This is tedious and defeats the purpose of having a UI.

Impact:

This makes Claude Code unusable for Bedrock users in non-US regions who need to switch models frequently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas reproHas detailed reproduction stepsstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions