fix(ai): enable cache control for OpenRouter aliases

closes #6940
This commit is contained in:
Mario Zechner
2026-07-22 11:46:21 +02:00
parent 33e40c3e15
commit 6f95a33888
9 changed files with 45 additions and 5 deletions
@@ -0,0 +1,15 @@
import { describe, expect, it } from "vitest";
import { getModel } from "../src/compat.ts";
const OPENROUTER_ANTHROPIC_LATEST_MODEL_IDS = [
"~anthropic/claude-fable-latest",
"~anthropic/claude-haiku-latest",
"~anthropic/claude-opus-latest",
"~anthropic/claude-sonnet-latest",
] as const;
describe("OpenRouter Anthropic cache control metadata", () => {
it.each(OPENROUTER_ANTHROPIC_LATEST_MODEL_IDS)("enables cache control for %s", (modelId) => {
expect(getModel("openrouter", modelId).compat?.cacheControlFormat).toBe("anthropic");
});
});