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
+2 -1
View File
@@ -572,7 +572,8 @@ function detectOpenAICompletionsCompat(model: Model<"openai-completions">): Open
const isDeepSeek = provider === "deepseek" || baseUrl.includes("deepseek.com");
const isOpenRouterDeveloperRoleModel =
isOpenRouter && (model.id.startsWith("anthropic/") || model.id.startsWith("openai/"));
const cacheControlFormat = provider === "openrouter" && model.id.startsWith("anthropic/") ? "anthropic" : undefined;
const cacheControlFormat =
provider === "openrouter" && /^~?anthropic\//.test(model.id) ? "anthropic" : undefined;
return {
supportsStore: !isNonStandard,