buildfix: fix tests referencing old models

This commit is contained in:
David Brailovsky
2026-07-17 13:24:11 +00:00
parent 64f83c85d9
commit 5124c61b25
16 changed files with 38 additions and 63 deletions
@@ -13,16 +13,8 @@ export const KIMI_CODING_MODELS = values as {
id: "k3";
provider: "kimi-coding";
};
"kimi-for-coding": Model<"anthropic-messages"> & {
id: "kimi-for-coding";
provider: "kimi-coding";
};
"kimi-for-coding-highspeed": Model<"anthropic-messages"> & {
id: "kimi-for-coding-highspeed";
provider: "kimi-coding";
};
"kimi-k2-thinking": Model<"anthropic-messages"> & {
id: "kimi-k2-thinking";
provider: "kimi-coding";
};
};
@@ -441,10 +441,6 @@ export const OPENROUTER_MODELS = values as {
id: "nex-agi/nex-n2-pro";
provider: "openrouter";
};
"nvidia/llama-3.3-nemotron-super-49b-v1.5": Model<"openai-completions"> & {
id: "nvidia/llama-3.3-nemotron-super-49b-v1.5";
provider: "openrouter";
};
"nvidia/nemotron-3-nano-30b-a3b": Model<"openai-completions"> & {
id: "nvidia/nemotron-3-nano-30b-a3b";
provider: "openrouter";
+1 -1
View File
@@ -250,7 +250,7 @@ describe("AI Providers Abort Tests", () => {
});
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider Abort", () => {
const llm = getModel("kimi-coding", "kimi-k2-thinking");
const llm = getModel("kimi-coding", "k2p7");
it("should abort mid-stream", { retry: 3 }, async () => {
await testAbortSignal(llm);
@@ -9,9 +9,7 @@ const EXPECTED_CURRENT_ADAPTIVE_THINKING_MODELS = [
"cloudflare-ai-gateway/claude-fable-5",
"kimi-coding/k2p7",
"kimi-coding/k3",
"kimi-coding/kimi-for-coding",
"kimi-coding/kimi-for-coding-highspeed",
"kimi-coding/kimi-k2-thinking",
"opencode/claude-opus-4-8",
"vercel-ai-gateway/anthropic/claude-opus-4.8",
"vercel-ai-gateway/anthropic/claude-sonnet-5",
@@ -97,7 +97,7 @@ describe("Anthropic empty thinking signature compat", () => {
expect(assistant?.content).toEqual([{ type: "thinking", thinking: "internal reasoning", signature: "" }]);
});
it.each(["k3", "kimi-for-coding"] as const)("allows empty signatures for Kimi Coding %s", async (modelId) => {
it.each(["k3"] as const)("allows empty signatures for Kimi Coding %s", async (modelId) => {
const model = getModel("kimi-coding", modelId);
expect(model.compat?.allowEmptySignature).toBe(true);
@@ -92,9 +92,7 @@ describe("Anthropic forceAdaptiveThinking compat override", () => {
it.each([
["k2p7", "medium", "medium"],
["k3", "max", "max"],
["kimi-for-coding", "medium", "medium"],
["kimi-for-coding-highspeed", "medium", "medium"],
["kimi-k2-thinking", "medium", "medium"],
] as const)(
"uses adaptive thinking effort without a token budget for Kimi Coding %s",
async (modelId, reasoning, effort) => {
+2 -2
View File
@@ -471,8 +471,8 @@ describe("Context overflow error handling", () => {
// =============================================================================
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding", () => {
it("kimi-k2-thinking - should detect overflow via isContextOverflow", async () => {
const model = getModel("kimi-coding", "kimi-k2-thinking");
it("k2p7 - should detect overflow via isContextOverflow", async () => {
const model = getModel("kimi-coding", "k2p7");
const result = await testContextOverflow(model, process.env.KIMI_API_KEY!);
logResult(result);
@@ -109,7 +109,7 @@ const PROVIDER_MODEL_PAIRS: ProviderModelPair[] = [
// Together AI
{ provider: "together", model: "moonshotai/Kimi-K2.6", label: "together-kimi-k2.6" },
// Kimi For Coding
{ provider: "kimi-coding", model: "kimi-k2-thinking", label: "kimi-coding-k2-thinking" },
{ provider: "kimi-coding", model: "k2p7", label: "kimi-coding-k2p7" },
// Mistral
{ provider: "mistral", model: "devstral-medium-latest", label: "mistral-devstral-medium" },
// MiniMax
+1 -1
View File
@@ -536,7 +536,7 @@ describe("AI Providers Empty Message Tests", () => {
);
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider Empty Messages", () => {
const llm = getModel("kimi-coding", "kimi-k2-thinking");
const llm = getModel("kimi-coding", "k2p7");
it("should handle empty content array", { retry: 3, timeout: 30000 }, async () => {
await testEmptyMessage(llm);
+2 -2
View File
@@ -381,8 +381,8 @@ describe("Tool Results with Images", () => {
},
);
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider (kimi-for-coding)", () => {
const llm = getModel("kimi-coding", "kimi-for-coding");
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider (k2p7)", () => {
const llm = getModel("kimi-coding", "k2p7");
it("should handle tool result with only image", { retry: 3, timeout: 30000 }, async () => {
await handleToolWithImageResult(llm);
-2
View File
@@ -61,9 +61,7 @@ describe("builtin providers", () => {
const expectedCosts = {
k2p7: { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 },
k3: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 0 },
"kimi-for-coding": { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 },
"kimi-for-coding-highspeed": { input: 1.9, output: 8, cacheRead: 0.38, cacheWrite: 0 },
"kimi-k2-thinking": { input: 0.6, output: 2.5, cacheRead: 0.15, cacheWrite: 0 },
};
for (const [modelId, cost] of Object.entries(expectedCosts)) {
+18 -21
View File
@@ -1017,32 +1017,29 @@ describe("Generate E2E Tests", () => {
});
});
describe.skipIf(!process.env.KIMI_API_KEY)(
"Kimi For Coding Provider (kimi-k2-thinking via Anthropic Messages)",
() => {
const llm = getModel("kimi-coding", "kimi-k2-thinking");
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider (k2p7 via Anthropic Messages)", () => {
const llm = getModel("kimi-coding", "k2p7");
it("should complete basic text generation", { retry: 3 }, async () => {
await basicTextGeneration(llm);
});
it("should complete basic text generation", { retry: 3 }, async () => {
await basicTextGeneration(llm);
});
it("should handle tool calling", { retry: 3 }, async () => {
await handleToolCall(llm);
});
it("should handle tool calling", { retry: 3 }, async () => {
await handleToolCall(llm);
});
it("should handle streaming", { retry: 3 }, async () => {
await handleStreaming(llm);
});
it("should handle streaming", { retry: 3 }, async () => {
await handleStreaming(llm);
});
it("should handle thinking mode", { retry: 3 }, async () => {
await handleThinking(llm, { thinkingEnabled: true, thinkingBudgetTokens: 2048 });
});
it("should handle thinking mode", { retry: 3 }, async () => {
await handleThinking(llm, { thinkingEnabled: true, thinkingBudgetTokens: 2048 });
});
it("should handle multi-turn with thinking and tools", { retry: 3 }, async () => {
await multiTurn(llm, { thinkingEnabled: true, thinkingBudgetTokens: 2048 });
});
},
);
it("should handle multi-turn with thinking and tools", { retry: 3 }, async () => {
await multiTurn(llm, { thinkingEnabled: true, thinkingBudgetTokens: 2048 });
});
});
describe.skipIf(!process.env.XIAOMI_API_KEY)(
"Xiaomi MiMo (API billing) Provider (Xiaomi MiMo-V2.5-Pro via Anthropic Messages)",
+1 -1
View File
@@ -218,7 +218,7 @@ describe("Token Statistics on Abort", () => {
});
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider", () => {
const llm = getModel("kimi-coding", "kimi-for-coding");
const llm = getModel("kimi-coding", "k2p7");
it("should include token stats when aborted mid-stream", { retry: 3, timeout: 30000 }, async () => {
await testTokensOnAbort(llm);
@@ -255,7 +255,7 @@ describe("Tool Call Without Result Tests", () => {
});
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider", () => {
const model = getModel("kimi-coding", "kimi-k2-thinking");
const model = getModel("kimi-coding", "k2p7");
it("should filter out tool calls without corresponding tool results", { retry: 3, timeout: 30000 }, async () => {
await testToolCallWithoutResult(model);
+9 -13
View File
@@ -567,22 +567,18 @@ describe("totalTokens field", () => {
// =========================================================================
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding", () => {
it(
"kimi-k2-thinking - should return totalTokens equal to sum of components",
{ retry: 3, timeout: 60000 },
async () => {
const llm = getModel("kimi-coding", "kimi-k2-thinking");
it("k2p7 - should return totalTokens equal to sum of components", { retry: 3, timeout: 60000 }, async () => {
const llm = getModel("kimi-coding", "k2p7");
console.log(`\nKimi For Coding / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: process.env.KIMI_API_KEY });
console.log(`\nKimi For Coding / ${llm.id}:`);
const { first, second } = await testTotalTokensWithCache(llm, { apiKey: process.env.KIMI_API_KEY });
logUsage("First request", first);
logUsage("Second request", second);
logUsage("First request", first);
logUsage("Second request", second);
assertTotalTokensEqualsComponents(first);
assertTotalTokensEqualsComponents(second);
},
);
assertTotalTokensEqualsComponents(first);
assertTotalTokensEqualsComponents(second);
});
});
// =========================================================================
+1 -1
View File
@@ -696,7 +696,7 @@ describe("AI Providers Unicode Surrogate Pair Tests", () => {
);
describe.skipIf(!process.env.KIMI_API_KEY)("Kimi For Coding Provider Unicode Handling", () => {
const llm = getModel("kimi-coding", "kimi-k2-thinking");
const llm = getModel("kimi-coding", "k2p7");
it("should handle emoji in tool results", { retry: 3, timeout: 30000 }, async () => {
await testEmojiInToolResults(llm);