diff --git a/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.test.ts b/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.test.ts index 56e622e98e1..1501dfa913a 100644 --- a/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.test.ts +++ b/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.test.ts @@ -156,6 +156,26 @@ describe("createMantleAnthropicStreamFn", () => { expect(streamOptions.effort).toBe("high"); }); + it("maps Mythos Preview minimal reasoning to low effort", () => { + const model = createTestModel({ + id: "anthropic.claude-mythos-preview", + name: "Claude Mythos Preview", + reasoning: true, + params: { canonicalModelId: "claude-mythos-preview" }, + }); + const deps = createTestDeps(); + deps.stream.mockReturnValue({ kind: "anthropic-stream" } as never); + + void createMantleAnthropicStreamFn(deps)(model, { messages: [] }, { + apiKey: "bedrock-bearer-token", + reasoning: "minimal", + }); + + const streamOptions = firstStreamOptions(deps); + expect(streamOptions.thinkingEnabled).toBe(true); + expect(streamOptions.effort).toBe("low"); + }); + it("normalizes Mantle provider URLs to the Anthropic endpoint", () => { expect(resolveMantleAnthropicBaseUrl("https://bedrock-mantle.us-east-1.api.aws/v1")).toBe( "https://bedrock-mantle.us-east-1.api.aws/anthropic", diff --git a/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts b/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts index 395fc23ec84..9ce3e9434ba 100644 --- a/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts +++ b/extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts @@ -48,9 +48,13 @@ function resolveMantleReasoning( return undefined; } const reasoning = options?.reasoning ?? (isClaudeMythosPreviewModel(model) ? "high" : undefined); - return isClaudeMythosPreviewModel(model) && (reasoning === "xhigh" || reasoning === "max") - ? "high" - : reasoning; + if (!isClaudeMythosPreviewModel(model)) { + return reasoning; + } + if (reasoning === "minimal") { + return "low"; + } + return reasoning === "xhigh" || reasoning === "max" ? "high" : reasoning; } function mergeHeaders(