fix: normalize anthropic model ids

This commit is contained in:
Peter Steinberger
2026-01-09 05:07:16 +00:00
parent 9114331218
commit f9fe067f68
3 changed files with 32 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import type { ClawdbotConfig } from "../config/config.js";
import { buildAllowedModelSet, modelKey } from "./model-selection.js";
import { buildAllowedModelSet, modelKey, parseModelRef } from "./model-selection.js";
const catalog = [
{
@@ -54,3 +54,13 @@ describe("buildAllowedModelSet", () => {
).toBe(true);
});
});
describe("parseModelRef", () => {
it("normalizes anthropic/opus-4.5 to claude-opus-4-5", () => {
const ref = parseModelRef("anthropic/opus-4.5", "anthropic");
expect(ref).toEqual({
provider: "anthropic",
model: "claude-opus-4-5",
});
});
});