Bedrock provider doesn't work with govcloud #1648

Closed
opened 2026-02-16 17:31:56 -05:00 by yindo · 3 comments
Owner

Originally created by @douglasdennis on GitHub (Sep 7, 2025).

Originally assigned to: @rekram1-node on GitHub.

The AWS Bedrock provider currently fails if using the US govcloud region with this message:

AI_APICallError: undefined: The provided model identifier is invalid.

The issue is the code here: https://github.com/sst/opencode/blob/dev/packages/opencode/src/provider/provider.ts#L82-L86

It tries to slap on the "us" region prefix without checking to make sure the region isn't govcloud (which also starts with us: us-gov-west-1 and us-gov-east-1). I believe the correct behavior for a govcloud call would be to not use the region prefix. I can put up a bugfix PR if folks are open to one.

Originally created by @douglasdennis on GitHub (Sep 7, 2025). Originally assigned to: @rekram1-node on GitHub. The AWS Bedrock provider currently fails if using the US govcloud region with this message: ``` AI_APICallError: undefined: The provided model identifier is invalid. ``` The issue is the code here: https://github.com/sst/opencode/blob/dev/packages/opencode/src/provider/provider.ts#L82-L86 It tries to slap on the "us" region prefix without checking to make sure the region isn't govcloud (which also starts with `us`: `us-gov-west-1` and `us-gov-east-1`). I believe the correct behavior for a govcloud call would be to not use the region prefix. I can put up a bugfix PR if folks are open to one.
yindo closed this issue 2026-02-16 17:31:56 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 7, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #467: AWS Bedrock not working on regions outside us-east-1 (same error message "The provided model identifier is invalid" due to region handling issues)
  • #136: Cannot call bedrock models with cross-region profile (related to the same code section that handles region prefixes like "us.")

Both issues involve problems with AWS Bedrock region handling and the same error message. Issue #467 specifically mentions the same error and region-related problems, while #136 discusses the exact code area you identified (region prefix handling).

Feel free to ignore if none of these address your specific govcloud case.

@github-actions[bot] commented on GitHub (Sep 7, 2025): This issue might be a duplicate of existing issues. Please check: - #467: AWS Bedrock not working on regions outside us-east-1 (same error message "The provided model identifier is invalid" due to region handling issues) - #136: Cannot call bedrock models with cross-region profile (related to the same code section that handles region prefixes like "us.") Both issues involve problems with AWS Bedrock region handling and the same error message. Issue #467 specifically mentions the same error and region-related problems, while #136 discusses the exact code area you identified (region prefix handling). Feel free to ignore if none of these address your specific govcloud case.
Author
Owner

@rekram1-node commented on GitHub (Sep 7, 2025):

bug fix would be welcome!
thanks @douglasdennis

@rekram1-node commented on GitHub (Sep 7, 2025): bug fix would be welcome! thanks @douglasdennis
Author
Owner

@douglasdennis commented on GitHub (Sep 8, 2025):

Pushed up a PR just a bit ago. Thanks for the quick response @rekram1-node

@douglasdennis commented on GitHub (Sep 8, 2025): Pushed up a PR just a bit ago. Thanks for the quick response @rekram1-node
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1648