diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.ts index 6e78ccbc..c895c931 100644 --- a/packages/opencode/src/provider/provider.ts +++ b/packages/opencode/src/provider/provider.ts @@ -121,8 +121,11 @@ export namespace Provider { } case "ap": { const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region) - if (isAustraliaRegion && modelID.startsWith("anthropic.claude-sonnet-4-5")) { - modelID = `au.${modelID}` + if (isAustraliaRegion && ["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((m) => + modelID.includes(m), + )) { + regionPrefix = "au" + modelID = `${regionPrefix}.${modelID}` } else { const modelRequiresPrefix = ["claude", "nova-lite", "nova-micro", "nova-pro"].some((m) => modelID.includes(m), @@ -270,31 +273,31 @@ export namespace Provider { cost: !model.cost && !existing?.cost ? { - input: 0, - output: 0, - cache_read: 0, - cache_write: 0, - } + input: 0, + output: 0, + cache_read: 0, + cache_write: 0, + } : { - cache_read: 0, - cache_write: 0, - ...existing?.cost, - ...model.cost, - }, + cache_read: 0, + cache_write: 0, + ...existing?.cost, + ...model.cost, + }, options: { ...existing?.options, ...model.options, }, limit: model.limit ?? existing?.limit ?? { - context: 0, - output: 0, - }, + context: 0, + output: 0, + }, modalities: model.modalities ?? existing?.modalities ?? { - input: ["text"], - output: ["text"], - }, + input: ["text"], + output: ["text"], + }, provider: model.provider ?? existing?.provider, } if (model.id && model.id !== modelID) {