fix: respect MINIMAX_API_HOST in bundled minimax catalogs (#34524) (thanks @caiqinghua)

This commit is contained in:
Peter Steinberger
2026-04-04 11:25:54 +01:00
parent 2c36ca562d
commit d58b4d7425
4 changed files with 37 additions and 9 deletions

View File

@@ -35,7 +35,7 @@ describe("NVIDIA provider", () => {
describe("MiniMax implicit provider (#15275)", () => {
it("should use anthropic-messages API for API-key provider", async () => {
const agentDir = mkdtempSync(join(tmpdir(), "openclaw-test-"));
await withEnvAsync({ MINIMAX_API_KEY: "test-key" }, async () => {
await withEnvAsync({ MINIMAX_API_KEY: "test-key", MINIMAX_API_HOST: undefined }, async () => {
const providers = await resolveImplicitProvidersForTest({ agentDir });
expect(providers?.minimax).toBeDefined();
expect(providers?.minimax?.api).toBe("anthropic-messages");
@@ -44,6 +44,19 @@ describe("MiniMax implicit provider (#15275)", () => {
});
});
it("should respect MINIMAX_API_HOST env var for CN endpoint (#34487)", async () => {
const agentDir = mkdtempSync(join(tmpdir(), "openclaw-test-"));
await withEnvAsync(
{ MINIMAX_API_KEY: "test-key", MINIMAX_API_HOST: "https://api.minimaxi.com" },
async () => {
const providers = await resolveImplicitProvidersForTest({ agentDir });
expect(providers?.minimax).toBeDefined();
expect(providers?.minimax?.baseUrl).toBe("https://api.minimaxi.com/anthropic");
expect(providers?.["minimax-portal"]?.baseUrl).toBe("https://api.minimaxi.com/anthropic");
},
);
});
it("should set authHeader for minimax portal provider", async () => {
const agentDir = mkdtempSync(join(tmpdir(), "openclaw-test-"));
await writeFile(