mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 03:30:24 +00:00
test(agents): normalize live model not-found skips
This commit is contained in:
21
src/agents/live-model-errors.test.ts
Normal file
21
src/agents/live-model-errors.test.ts
Normal 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,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user