Skip to content

Commit c79abfb

Browse files
committed
test(bedrock): tighten custom ARN base model assertion and cover tier-less 1M pricing
- Assert no awsCustomArnBaseModelId update at all when re-selecting custom-arn - Cover 1M context for a base model without a pricing tier (Sonnet 4.5) Refs #1968
1 parent 278ecaa commit c79abfb

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎webview-ui/src/components/settings/utils/__tests__/providerModelConfig.spec.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ describe("providerModelConfig", () => {
307307
handleModelChangeSideEffects(providerIdentifiers.bedrock, "custom-arn", setApiConfigurationField)
308308

309309
expect(setApiConfigurationField).not.toHaveBeenCalledWith("awsCustomArn", expect.anything())
310-
expect(setApiConfigurationField).not.toHaveBeenCalledWith("awsCustomArnBaseModelId", expect.anything())
310+
expect(
311+
setApiConfigurationField.mock.calls.filter(([field]) => field === "awsCustomArnBaseModelId"),
312+
).toHaveLength(0)
311313
expect(setApiConfigurationField).toHaveBeenCalledWith("reasoningEffort", undefined)
312314
expect(setApiConfigurationField).toHaveBeenCalledWith("modelMaxTokens", undefined)
313315
expect(setApiConfigurationField).toHaveBeenCalledWith("modelMaxThinkingTokens", undefined)

‎webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,24 @@ describe("useSelectedModel", () => {
874874
)
875875
})
876876

877+
it("keeps standard pricing with 1M context for a custom ARN base model without a pricing tier", () => {
878+
const sonnet45: ModelInfo = bedrockModels["anthropic.claude-sonnet-4-5-20250929-v1:0"]
879+
expect(sonnet45.tiers).toBeUndefined()
880+
881+
expect(
882+
renderCustomArn({
883+
awsCustomArnBaseModelId: "anthropic.claude-sonnet-4-5-20250929-v1:0",
884+
awsBedrock1MContext: true,
885+
}).info,
886+
).toMatchObject({
887+
contextWindow: 1_000_000,
888+
inputPrice: sonnet45.inputPrice,
889+
outputPrice: sonnet45.outputPrice,
890+
cacheWritesPrice: sonnet45.cacheWritesPrice,
891+
cacheReadsPrice: sonnet45.cacheReadsPrice,
892+
})
893+
})
894+
877895
it("applies a configured context window to a listed custom ARN base model", () => {
878896
expect(
879897
renderCustomArn({

0 commit comments

Comments
 (0)