Update Claude Opus and GPT thinking metadata

This commit is contained in:
Mario Zechner
2026-05-28 21:51:40 +02:00
parent ae50dec121
commit bfa3d1fa60
15 changed files with 306 additions and 61 deletions

View File

@@ -2,22 +2,10 @@ import { describe, expect, it } from "vitest";
import { getModels, getProviders } from "../src/models.ts";
import type { Api, Model } from "../src/types.ts";
const EXPECTED_ADAPTIVE_THINKING_MODELS = [
"anthropic/claude-opus-4-6",
"anthropic/claude-opus-4-7",
"anthropic/claude-sonnet-4-6",
"cloudflare-ai-gateway/claude-opus-4-6",
"cloudflare-ai-gateway/claude-opus-4-7",
"cloudflare-ai-gateway/claude-sonnet-4-6",
"github-copilot/claude-opus-4.6",
"github-copilot/claude-opus-4.7",
"github-copilot/claude-sonnet-4.6",
"opencode/claude-opus-4-6",
"opencode/claude-opus-4-7",
"opencode/claude-sonnet-4-6",
"vercel-ai-gateway/anthropic/claude-opus-4.6",
"vercel-ai-gateway/anthropic/claude-opus-4.7",
"vercel-ai-gateway/anthropic/claude-sonnet-4.6",
const EXPECTED_CURRENT_ADAPTIVE_THINKING_MODELS = [
"anthropic/claude-opus-4-8",
"opencode/claude-opus-4-8",
"vercel-ai-gateway/anthropic/claude-opus-4.8",
];
function getAllModels(): Model<Api>[] {
@@ -25,13 +13,16 @@ function getAllModels(): Model<Api>[] {
}
describe("Anthropic adaptive thinking model metadata", () => {
it("marks exactly the built-in Anthropic Messages models that use adaptive thinking", () => {
it("marks built-in Anthropic Messages models that use adaptive thinking", () => {
const flaggedModels = getAllModels()
.filter((model): model is Model<"anthropic-messages"> => model.api === "anthropic-messages")
.filter((model) => model.compat?.forceAdaptiveThinking === true)
.map((model) => `${model.provider}/${model.id}`)
.sort();
expect(flaggedModels).toEqual([...EXPECTED_ADAPTIVE_THINKING_MODELS].sort());
expect(flaggedModels).toEqual(expect.arrayContaining([...EXPECTED_CURRENT_ADAPTIVE_THINKING_MODELS].sort()));
expect(flaggedModels).toEqual(
flaggedModels.filter((modelId) => /(opus[-.]4[-.][678]|sonnet[-.]4[-.]6)/.test(modelId)),
);
});
});