From 08227dd749d1d9a716a7b5e1b96346073deeaf49 Mon Sep 17 00:00:00 2001 From: Diego Duran Date: Wed, 7 Oct 2026 22:21:39 +0000 Subject: [PATCH 1/2] fix(core): recognize Claude Bedrock family metadata --- packages/core/src/variant.ts | 2 +- packages/core/test/variant.test.ts | 34 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/core/src/variant.ts b/packages/core/src/variant.ts index 4f3cb4e3cefb..1e35039cb074 100644 --- a/packages/core/src/variant.ts +++ b/packages/core/src/variant.ts @@ -409,7 +409,7 @@ const openrouter: Protocol = (model, support) => { const bedrockConverse: Protocol = (model, support) => { const id = modelID(model) - const claude = id.includes("anthropic") + const claude = id.includes("anthropic") || model.family === "claude" || model.family?.startsWith("claude-") const fields = (fields: Record): Overlay => ({ body: { additionalModelRequestFields: fields } }) switch (support.type) { case "effort": diff --git a/packages/core/test/variant.test.ts b/packages/core/test/variant.test.ts index 8f2367bc7acf..439587465b3a 100644 --- a/packages/core/test/variant.test.ts +++ b/packages/core/test/variant.test.ts @@ -261,6 +261,40 @@ test("spells Chat Completions variants for direct providers", () => { ]) }) +test("recognizes Claude family metadata for Bedrock inference profile ARNs", () => { + const input = model("@opencode/ai/providers/amazon-bedrock", "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/opaque") as Model.MutableInfo + input.family = Model.Family.make("claude-sonnet") + + expect(resolve(Model.Info.make(input), [{ type: "effort", values: ["high"] }])).toEqual([ + { + id: "high", + body: { + additionalModelRequestFields: { + thinking: { type: "adaptive", display: "summarized" }, + output_config: { effort: "high" }, + }, + }, + }, + ]) +}) + +test("recognizes the bare Claude family for Bedrock inference profile ARNs", () => { + const input = model("@opencode/ai/providers/amazon-bedrock", "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/opaque") as Model.MutableInfo + input.family = Model.Family.make("claude") + + expect(resolve(Model.Info.make(input), [{ type: "effort", values: ["high"] }])).toEqual([ + { + id: "high", + body: { + additionalModelRequestFields: { + thinking: { type: "adaptive", display: "summarized" }, + output_config: { effort: "high" }, + }, + }, + }, + ]) +}) + test("spells Bedrock Converse Claude budgets as a thinking setting", () => { expect( resolve(model("@opencode/ai/providers/amazon-bedrock", "us.anthropic.claude-haiku-4-5-20251001-v1:0", 64_000), [ From 6729fa14f58089b7927e5af7ca14aea005846cc4 Mon Sep 17 00:00:00 2001 From: Diego Duran Date: Wed, 7 Oct 2026 23:04:37 +0000 Subject: [PATCH 2/2] test(core): cover opaque Bedrock family routing --- packages/core/test/variant.test.ts | 59 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/packages/core/test/variant.test.ts b/packages/core/test/variant.test.ts index 439587465b3a..5988ef43e1b3 100644 --- a/packages/core/test/variant.test.ts +++ b/packages/core/test/variant.test.ts @@ -262,37 +262,22 @@ test("spells Chat Completions variants for direct providers", () => { }) test("recognizes Claude family metadata for Bedrock inference profile ARNs", () => { - const input = model("@opencode/ai/providers/amazon-bedrock", "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/opaque") as Model.MutableInfo - input.family = Model.Family.make("claude-sonnet") - - expect(resolve(Model.Info.make(input), [{ type: "effort", values: ["high"] }])).toEqual([ - { - id: "high", - body: { - additionalModelRequestFields: { - thinking: { type: "adaptive", display: "summarized" }, - output_config: { effort: "high" }, + for (const family of ["claude-sonnet", "claude"]) { + const input = model("@opencode/ai/providers/amazon-bedrock", "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/opaque") as Model.MutableInfo + input.family = Model.Family.make(family) + + expect(resolve(Model.Info.make(input), [{ type: "effort", values: ["high"] }])).toEqual([ + { + id: "high", + body: { + additionalModelRequestFields: { + thinking: { type: "adaptive", display: "summarized" }, + output_config: { effort: "high" }, + }, }, }, - }, - ]) -}) - -test("recognizes the bare Claude family for Bedrock inference profile ARNs", () => { - const input = model("@opencode/ai/providers/amazon-bedrock", "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/opaque") as Model.MutableInfo - input.family = Model.Family.make("claude") - - expect(resolve(Model.Info.make(input), [{ type: "effort", values: ["high"] }])).toEqual([ - { - id: "high", - body: { - additionalModelRequestFields: { - thinking: { type: "adaptive", display: "summarized" }, - output_config: { effort: "high" }, - }, - }, - }, - ]) + ]) + } }) test("spells Bedrock Converse Claude budgets as a thinking setting", () => { @@ -322,6 +307,22 @@ test("spells Bedrock Converse effort for Grok and Nova", () => { body: { additionalModelRequestFields: { reasoningConfig: { type: "enabled", maxReasoningEffort: "xhigh" } } }, }, ]) + + const inferenceProfile = model( + "@opencode/ai/providers/amazon-bedrock", + "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/opaque", + ) as Model.MutableInfo + inferenceProfile.family = Model.Family.make("nova") + expect(resolve(Model.Info.make(inferenceProfile), supports)).toEqual([ + { + id: "low", + body: { additionalModelRequestFields: { reasoningConfig: { type: "enabled", maxReasoningEffort: "low" } } }, + }, + { + id: "xhigh", + body: { additionalModelRequestFields: { reasoningConfig: { type: "enabled", maxReasoningEffort: "xhigh" } } }, + }, + ]) }) test("caps Alibaba thinking budget variants at 64k", () => {