mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
fix(core): send Grok reasoning effort on Bedrock Converse (#51151)
This commit is contained in:
committed by
GitHub
Unverified
parent
6afcc887c8
commit
0e4ad0ce76
@@ -378,7 +378,7 @@ const bedrockConverse: Protocol = (model, support) => {
|
||||
output_config: { effort },
|
||||
})
|
||||
if (id.includes("openai.gpt-oss")) return fields({ reasoning_effort: effort })
|
||||
if (id.includes("openai.")) return fields({ reasoning: { effort } })
|
||||
if (id.includes("openai.") || id.includes("xai.")) return fields({ reasoning: { effort } })
|
||||
return fields({ reasoningConfig: { type: "enabled", maxReasoningEffort: effort } })
|
||||
})
|
||||
case "toggle":
|
||||
|
||||
@@ -196,6 +196,24 @@ test("spells Chat Completions variants for direct providers", () => {
|
||||
])
|
||||
})
|
||||
|
||||
test("spells Bedrock Converse effort for Grok and Nova", () => {
|
||||
const supports: Variant.Support[] = [{ type: "effort", values: ["low", "xhigh"] }]
|
||||
expect(resolve(model("@opencode/ai/providers/amazon-bedrock", "us.xai.grok-4.6"), supports)).toEqual([
|
||||
{ id: "low", body: { additionalModelRequestFields: { reasoning: { effort: "low" } } } },
|
||||
{ id: "xhigh", body: { additionalModelRequestFields: { reasoning: { effort: "xhigh" } } } },
|
||||
])
|
||||
expect(resolve(model("@opencode/ai/providers/amazon-bedrock", "us.amazon.nova-2-lite-v1:0"), supports)).toEqual([
|
||||
{
|
||||
id: "low",
|
||||
body: { additionalModelRequestFields: { reasoningConfig: { type: "enabled", maxReasoningEffort: "low" } } },
|
||||
},
|
||||
{
|
||||
id: "xhigh",
|
||||
body: { additionalModelRequestFields: { reasoningConfig: { type: "enabled", maxReasoningEffort: "xhigh" } } },
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
test("spells Chat Completions variants for hosting providers", () => {
|
||||
expect(
|
||||
resolve(model("@opencode/ai/providers/openai-compatible", "deepseek-ai/deepseek-v4-pro", undefined, "nvidia"), [
|
||||
|
||||
Reference in New Issue
Block a user