mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 13:00:45 +08:00
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { normalizeXaiModelId } from "./api.js";
|
|
|
|
describe("normalizeXaiModelId", () => {
|
|
it("maps deprecated grok 4.20 beta ids to GA ids", () => {
|
|
expect(normalizeXaiModelId("grok-4.20-experimental-beta-0304-reasoning")).toBe(
|
|
"grok-4.20-beta-latest-reasoning",
|
|
);
|
|
expect(normalizeXaiModelId("grok-4.20-experimental-beta-0304-non-reasoning")).toBe(
|
|
"grok-4.20-beta-latest-non-reasoning",
|
|
);
|
|
});
|
|
|
|
it("maps older fast and 4.20 ids to the current Pi-backed ids", () => {
|
|
expect(normalizeXaiModelId("grok-4-fast-reasoning")).toBe("grok-4-fast");
|
|
expect(normalizeXaiModelId("grok-4-1-fast-reasoning")).toBe("grok-4-1-fast");
|
|
expect(normalizeXaiModelId("grok-4.20-reasoning")).toBe("grok-4.20-beta-latest-reasoning");
|
|
expect(normalizeXaiModelId("grok-4.20-non-reasoning")).toBe(
|
|
"grok-4.20-beta-latest-non-reasoning",
|
|
);
|
|
});
|
|
|
|
it("leaves current xai model ids unchanged", () => {
|
|
expect(normalizeXaiModelId("grok-4.20-beta-latest-reasoning")).toBe(
|
|
"grok-4.20-beta-latest-reasoning",
|
|
);
|
|
expect(normalizeXaiModelId("grok-4")).toBe("grok-4");
|
|
});
|
|
});
|