fix(ai): update tests for current model catalogs

This commit is contained in:
David Brailovsky 2026-09-18 09:48:55 +02:00
parent 46c9de402b
commit ea9e093516
3 changed files with 18 additions and 28 deletions

View file

@ -563,7 +563,7 @@ describe("Context overflow error handling", () => {
// Mistral backend
it("mistralai/mistral-large-2512 via OpenRouter - should detect overflow via isContextOverflow", async () => {
const model = getModel("openrouter", "mistralai/mistral-large-2512");
const model = getModel("openrouter", "mistralai/mistral-large");
const result = await testContextOverflow(model, process.env.OPENROUTER_API_KEY!);
logResult(result);

View file

@ -320,21 +320,21 @@ describe("openai-completions tool_choice", () => {
});
it("stores z.ai effort metadata", () => {
for (const provider of ["zai", "zai-coding-cn"] as const) {
for (const modelId of ["glm-5.2", "glm-5.2-highspeed"] as const) {
const model = getModel(provider, modelId)!;
expect(model.compat?.supportsReasoningEffort).toBe(true);
expect(model.thinkingLevelMap).toEqual({
off: "none",
minimal: null,
low: null,
medium: null,
high: "high",
xhigh: null,
max: "max",
});
}
for (const modelId of ["glm-5.2", "glm-5.2-highspeed"] as const) {
const model = getModel("zai", modelId)!;
expect(model.compat?.supportsReasoningEffort).toBe(true);
expect(model.thinkingLevelMap).toEqual({
off: "none",
minimal: null,
low: null,
medium: null,
high: "high",
xhigh: null,
max: "max",
});
}
for (const provider of ["zai", "zai-coding-cn"] as const) {
const glm53 = getModel(provider, "glm-5.3")!;
expect(glm53.compat?.supportsReasoningEffort).toBe(true);
expect(glm53.thinkingLevelMap).toEqual({

View file

@ -29,18 +29,6 @@ it("uses API-equivalent reference costs for Coding Plan models", () => {
cacheRead: 0.26,
cacheWrite: 0,
});
expect(getBuiltinModel("zai-coding-cn", "glm-5.1").cost).toEqual({
input: 1.4,
output: 4.4,
cacheRead: 0.26,
cacheWrite: 0,
});
expect(getBuiltinModel("zai-coding-cn", "glm-5v-turbo").cost).toEqual({
input: 1.2,
output: 4,
cacheRead: 0.24,
cacheWrite: 0,
});
for (const provider of ["zai", "zai-coding-cn"] as const) {
expect(getBuiltinModel(provider, "glm-5.3").cost).toEqual({
input: 1.4,
@ -54,7 +42,9 @@ it("uses API-equivalent reference costs for Coding Plan models", () => {
it("keeps zero costs for Coding Plan models without a matching API price", () => {
const zeroCost = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
expect(getBuiltinModel("zai", "glm-5.2-highspeed").cost).toEqual(zeroCost);
for (const provider of ["zai", "zai-coding-cn"] as const) {
expect(getBuiltinModel(provider, "glm-5.2-highspeed").cost).toEqual(zeroCost);
expect(getBuiltinModel(provider, "glm-5.3-highspeed").cost).toEqual(zeroCost);
}
});