fix: global prefix handling w/ aws bedrock (#4757)

This commit is contained in:
Aiden Cline 2025-11-25 16:16:13 -08:00 committed by opencode
parent 0ff4c284e2
commit b44971668c
2 changed files with 6 additions and 1 deletions

View file

@ -4,7 +4,7 @@ on:
push:
branches:
- dev
- fix-snapshot-2
- test-bedrock
- v0
concurrency: ${{ github.workflow }}-${{ github.ref }}

View file

@ -130,6 +130,11 @@ export namespace Provider {
credentialProvider: fromNodeProviderChain(),
},
async getModel(sdk: any, modelID: string, _options?: Record<string, any>) {
// Skip region prefixing if model already has global prefix
if (modelID.startsWith("global.")) {
return sdk.languageModel(modelID)
}
let regionPrefix = region.split("-")[0]
switch (regionPrefix) {