fix: normalize anthropic model ids
This commit is contained in:
@@ -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",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user