test(agents): normalize live model not-found skips

This commit is contained in:
Peter Steinberger
2026-03-08 13:43:31 +00:00
parent f930fcbd3f
commit f66cc886d3
3 changed files with 63 additions and 18 deletions

View File

@@ -0,0 +1,21 @@
import { describe, expect, it } from "vitest";
import {
isMiniMaxModelNotFoundErrorMessage,
isModelNotFoundErrorMessage,
} from "./live-model-errors.js";
describe("live model error helpers", () => {
it("detects generic model-not-found messages", () => {
expect(isModelNotFoundErrorMessage('{"code":404,"message":"model not found"}')).toBe(true);
expect(isModelNotFoundErrorMessage("model: MiniMax-M2.5-highspeed not found")).toBe(true);
expect(isModelNotFoundErrorMessage("request ended without sending any chunks")).toBe(false);
});
it("detects bare minimax 404 page-not-found responses", () => {
expect(isMiniMaxModelNotFoundErrorMessage("404 page not found")).toBe(true);
expect(isMiniMaxModelNotFoundErrorMessage("Error: 404 404 page not found")).toBe(true);
expect(isMiniMaxModelNotFoundErrorMessage("request ended without sending any chunks")).toBe(
false,
);
});
});