supports-xhigh.test.ts 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import { describe, expect, it } from "vitest";
  2. import { getModel, getSupportedThinkingLevels } from "../src/models.ts";
  3. describe("getSupportedThinkingLevels", () => {
  4. it("includes xhigh for Anthropic Opus 4.6 on anthropic-messages API", () => {
  5. const model = getModel("anthropic", "claude-opus-4-6");
  6. expect(model).toBeDefined();
  7. expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
  8. });
  9. it("includes xhigh for Anthropic Opus 4.8 on anthropic-messages API", () => {
  10. const model = getModel("anthropic", "claude-opus-4-8");
  11. expect(model).toBeDefined();
  12. expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
  13. });
  14. it("includes xhigh for Anthropic Opus 4.8 on anthropic-messages API", () => {
  15. const model = getModel("anthropic", "claude-opus-4-8");
  16. expect(model).toBeDefined();
  17. expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
  18. });
  19. it("includes xhigh for Anthropic Claude Fable 5 on anthropic-messages API", () => {
  20. const model = getModel("anthropic", "claude-fable-5");
  21. expect(model).toBeDefined();
  22. expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
  23. });
  24. it("does not include xhigh for Claude Sonnet 4.5", () => {
  25. const model = getModel("anthropic", "claude-sonnet-4-5");
  26. expect(model).toBeDefined();
  27. expect(getSupportedThinkingLevels(model!)).not.toContain("xhigh");
  28. });
  29. it.each(["gpt-5.4", "gpt-5.5"] as const)("includes xhigh for %s models", (modelId) => {
  30. const model = getModel("openai-codex", modelId);
  31. expect(model).toBeDefined();
  32. expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
  33. });
  34. it("includes only medium/high/xhigh for OpenAI GPT-5.5 Pro", () => {
  35. const model = getModel("openai", "gpt-5.5-pro");
  36. expect(model).toBeDefined();
  37. expect(getSupportedThinkingLevels(model!)).toEqual(["medium", "high", "xhigh"]);
  38. });
  39. it("includes only medium/high/xhigh for OpenRouter GPT-5.5 Pro", () => {
  40. const model = getModel("openrouter", "openai/gpt-5.5-pro");
  41. expect(model).toBeDefined();
  42. expect(getSupportedThinkingLevels(model!)).toEqual(["medium", "high", "xhigh"]);
  43. });
  44. it("includes only high/xhigh plus off for DeepSeek V4 Flash on the DeepSeek provider", () => {
  45. const model = getModel("deepseek", "deepseek-v4-flash");
  46. expect(model).toBeDefined();
  47. expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high", "xhigh"]);
  48. });
  49. it("includes only high/xhigh plus off for DeepSeek V4 Flash on opencode-go", () => {
  50. const model = getModel("opencode-go", "deepseek-v4-flash");
  51. expect(model).toBeDefined();
  52. expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high", "xhigh"]);
  53. });
  54. it("includes only high plus off for OpenCode Go Kimi K2.6", () => {
  55. const model = getModel("opencode-go", "kimi-k2.6");
  56. expect(model).toBeDefined();
  57. expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high"]);
  58. });
  59. it("includes only high for OpenCode Grok Build", () => {
  60. const model = getModel("opencode", "grok-build-0.1");
  61. expect(model).toBeDefined();
  62. expect(getSupportedThinkingLevels(model!)).toEqual(["high"]);
  63. });
  64. it("includes only high/xhigh plus off for DeepSeek V4 Flash on OpenRouter", () => {
  65. const model = getModel("openrouter", "deepseek/deepseek-v4-flash");
  66. expect(model).toBeDefined();
  67. expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high", "xhigh"]);
  68. });
  69. it("includes xhigh for OpenRouter Opus 4.6 (openai-completions API)", () => {
  70. const model = getModel("openrouter", "anthropic/claude-opus-4.6");
  71. expect(model).toBeDefined();
  72. expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
  73. });
  74. it("includes xhigh for Bedrock Claude Fable 5", () => {
  75. const model = getModel("amazon-bedrock", "global.anthropic.claude-fable-5");
  76. expect(model).toBeDefined();
  77. expect(getSupportedThinkingLevels(model!)).toContain("xhigh");
  78. });
  79. });