Repository navigation
fix(core): apply us-gov prefix for Bedrock models in GovCloud regions - #49055
jeff-armis wants to merge 3 commits into
Conversation
Fixes the incomplete fix from PR anomalyco#2495 which addressed issue anomalyco#2481. PR anomalyco#2495 added GovCloud detection but prevented prefix application for GovCloud regions, when they actually require the "us-gov." prefix. Changes: - Add "us-gov." to crossRegionPrefixes skip list (prevents double-prefixing) - Add "grok" and "nemotron" to models requiring prefixes - Apply "us-gov." prefix for GovCloud regions (was no prefix before) - Update tests to expect correct us-gov. prefix behavior Tested with both us-gov-east-1 (GovCloud) and us-east-1 (commercial).
|
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: The search found one potentially related PR: PR #18948: This PR is related as it addresses prefix handling for Bedrock models, though it focuses on preventing prefixes for ARN and deepseek.v3.2 rather than applying the us-gov prefix for GovCloud regions. Both PRs deal with the core issue of correct model ID prefixing behavior in the Bedrock provider. However, this appears to be a distinct fix for the incomplete solution from PR #2495, so PR #49055 doesn't appear to be a direct duplicate—it's a follow-up fix for issue #2481. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
This isn't mergeable as-is:
Please split these cases and cover both provider paths with tests. |
Cross-region inference profiles differ by partition. Verified against the live Bedrock catalog (list-inference-profiles): - GovCloud: us-gov. profiles exist for claude, grok, nemotron; nova has no us-gov. profile (bare in-region id). - Commercial: us. profiles exist for nova, claude, deepseek.r1, grok; nemotron has no us. profile (bare in-region id). Also add us-gov. to crossRegionPrefixes in packages/opencode provider so an explicit us-gov.* id is not double-prefixed, and add GovCloud coverage to the opencode provider test path.
Thanks — good catch. Verified against the live Bedrock catalog (`aws bedrock list-inference-profiles`) in both partitions and split the lists accordingly:
Changes:
|
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
Issue for this PR
Closes #2481
Type of change
What does this PR do?
PR #2495 attempted to fix GovCloud support but incorrectly prevented prefix application for GovCloud regions. AWS Bedrock requires
us-gov.prefix for cross-region inference in GovCloud (similar to how commercial US regions needus.prefix).The original fix detected GovCloud with
if (requiresPrefix && !isGovCloud)which skipped prefixing entirely. This caused "invalid model identifier" errors.This PR corrects the logic to apply
us-gov.prefix for GovCloud regions and adds missing models (Grok, Nemotron) to the prefix list.How did you verify your code works?
Manually tested with OpenCode built from source:
us-gov.prefixus.prefixScreenshots / recordings
N/A - Backend logic change
Checklist