From 938b1e022525a299baedfb80da2aed46aedf374c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 11 May 2026 16:08:18 +0100 Subject: [PATCH] test: cover MiniMax Anthropic route guard --- extensions/minimax/index.test.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/extensions/minimax/index.test.ts b/extensions/minimax/index.test.ts index 805b8f86bd2..80767393d8d 100644 --- a/extensions/minimax/index.test.ts +++ b/extensions/minimax/index.test.ts @@ -160,6 +160,36 @@ describe("minimax provider hooks", () => { }); }); + it("keeps M2.7 on the Anthropic Messages route used by the empty-history guard", async () => { + const { providers } = await registerProviderPlugin({ + plugin: minimaxProviderPlugin, + id: "minimax", + name: "MiniMax Provider", + }); + const apiProvider = requireRegisteredProvider(providers, "minimax"); + + const catalog = await apiProvider.catalog?.run({ + env: {}, + config: {}, + resolveProviderApiKey: (providerId?: string) => ({ + apiKey: providerId === "minimax" ? "sk-minimax-test" : undefined, + }), + } as never); + + const provider = "provider" in (catalog ?? {}) ? catalog?.provider : undefined; + expect(provider).toMatchObject({ + api: "anthropic-messages", + authHeader: true, + baseUrl: "https://api.minimax.io/anthropic", + }); + expect(provider?.models.find((model) => model.id === "MiniMax-M2.7")).toMatchObject({ + id: "MiniMax-M2.7", + input: ["text"], + name: "MiniMax M2.7", + reasoning: true, + }); + }); + it("owns fast-mode stream wrapping for MiniMax transports", async () => { const { providers } = await registerProviderPlugin({ plugin: minimaxProviderPlugin,