openclaw/extensions/xai/openclaw.plugin.test.ts
Peter Steinberger eae3fc1a79
feat(xai): add Grok 4.5 support (#102316)
* feat(xai): add Grok 4.5 support

* chore: leave release notes to release automation
2026-07-09 01:39:03 +01:00

43 lines
1.3 KiB
TypeScript

import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const manifest = JSON.parse(
readFileSync(new URL("./openclaw.plugin.json", import.meta.url), "utf8"),
) as {
modelIdNormalization?: {
providers?: Record<string, { aliases?: Record<string, string> }>;
};
modelCatalog?: {
suppressions?: Array<{ provider?: string; model?: string }>;
};
};
const XAI_MULTI_AGENT_MODELS = [
"grok-4.20-multi-agent-0309",
"grok-4.20-multi-agent",
"grok-4.20-multi-agent-latest",
"grok-4.20-multi-agent-beta-latest",
"grok-4.20-multi-agent-experimental-beta-0304",
"grok-4.20-multi-agent-experimental-beta-latest",
"grok-4.20-multi-agent-beta-0309",
] as const;
describe("xAI plugin manifest", () => {
it("normalizes the Grok Build latest alias to Grok 4.5", () => {
expect(manifest.modelIdNormalization?.providers?.xai?.aliases?.["grok-build-latest"]).toBe(
"grok-4.5",
);
});
it("suppresses the unsupported multi-agent model aliases", () => {
const suppressionRefs = new Set(
(manifest.modelCatalog?.suppressions ?? []).map(
(suppression) => `${suppression.provider}/${suppression.model}`,
),
);
for (const model of XAI_MULTI_AGENT_MODELS) {
expect(suppressionRefs).toContain(`xai/${model}`);
}
});
});