Files
sproutclaw/packages/ai/test/supports-xhigh.test.ts
2026-05-28 21:51:55 +02:00

71 lines
2.9 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { getModel, getSupportedThinkingLevels } from "../src/models.ts";
describe("getSupportedThinkingLevels", () => {
it("includes xhigh for Anthropic Opus 4.6 on anthropic-messages API", () => {
const model = getModel("anthropic", "claude-opus-4-6");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
});
it("includes xhigh for Anthropic Opus 4.8 on anthropic-messages API", () => {
const model = getModel("anthropic", "claude-opus-4-8");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
});
it("includes xhigh for Anthropic Opus 4.8 on anthropic-messages API", () => {
const model = getModel("anthropic", "claude-opus-4-8");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
});
it("does not include xhigh for non-Opus Anthropic models", () => {
const model = getModel("anthropic", "claude-sonnet-4-5");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).not.toContain("xhigh");
});
it.each(["gpt-5.4", "gpt-5.5"] as const)("includes xhigh for %s models", (modelId) => {
const model = getModel("openai-codex", modelId);
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
});
it("includes only medium/high/xhigh for OpenAI GPT-5.5 Pro", () => {
const model = getModel("openai", "gpt-5.5-pro");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toEqual(["medium", "high", "xhigh"]);
});
it("includes only medium/high/xhigh for OpenRouter GPT-5.5 Pro", () => {
const model = getModel("openrouter", "openai/gpt-5.5-pro");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toEqual(["medium", "high", "xhigh"]);
});
it("includes only high/xhigh plus off for DeepSeek V4 Flash on the DeepSeek provider", () => {
const model = getModel("deepseek", "deepseek-v4-flash");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high", "xhigh"]);
});
it("includes only high/xhigh plus off for DeepSeek V4 Flash on opencode-go", () => {
const model = getModel("opencode-go", "deepseek-v4-flash");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high", "xhigh"]);
});
it("includes only high/xhigh plus off for DeepSeek V4 Flash on OpenRouter", () => {
const model = getModel("openrouter", "deepseek/deepseek-v4-flash");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high", "xhigh"]);
});
it("includes xhigh for OpenRouter Opus 4.6 (openai-completions API)", () => {
const model = getModel("openrouter", "anthropic/claude-opus-4.6");
expect(model).toBeDefined();
expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
});
});