From 26201f7b6fc22bc728fc2dd4f0ea33b840a92116 Mon Sep 17 00:00:00 2001 From: darwintree <17946284+darwintree@users.noreply.github.com> Date: Wed, 26 Aug 2026 11:17:01 +0800 Subject: [PATCH] fix(command-code): add reasoning effort presets --- src/providers/command-code-efforts.ts | 12 ++++++++++++ tests/command-code-provider.test.ts | 22 +++++++++++++++++++++- tests/commandcode-provider.test.ts | 23 +++++++++++++++++++++-- tests/fixtures/commandcode-models.json | 2 +- 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/providers/command-code-efforts.ts b/src/providers/command-code-efforts.ts index b7d5b15d1b..1b1e9b610e 100644 --- a/src/providers/command-code-efforts.ts +++ b/src/providers/command-code-efforts.ts @@ -9,6 +9,18 @@ const COMMAND_CODE_MODEL_EFFORTS = { efforts: ["high", "max"], profileUrl: "https://commandcode.ai/models/deepseek-v4-flash", }, + "deepseek/deepseek-v4-flash-vision-exp": { + efforts: ["high", "max"], + profileUrl: "https://commandcode.ai/models/deepseek-v4-flash-vision-exp", + }, + "gpt-5.6-luna": { + efforts: ["low", "medium", "high", "xhigh", "max"], + profileUrl: "https://commandcode.ai/models/gpt-5-6-luna", + }, + "google/gemini-3.7-flash": { + efforts: ["low", "medium", "high"], + profileUrl: "https://commandcode.ai/models/gemini-3-7-flash", + }, // Ox Alpha (stealth preview, added in Command Code v1.31.0): free 1M-context // reasoning model on every plan. The profile does not publish an effort ladder, // so mirror the OpenRouter contract (reasoning mandatory; max/high/low). diff --git a/tests/command-code-provider.test.ts b/tests/command-code-provider.test.ts index b342b56da5..58d09657d6 100644 --- a/tests/command-code-provider.test.ts +++ b/tests/command-code-provider.test.ts @@ -2,7 +2,11 @@ import { afterEach, describe, expect, test } from "bun:test"; import { createCommandCodeAdapter } from "../src/adapters/command-code"; import { loginCommandCode, parseCommandCodeCallback, shouldImportLocalCommandCodeAuth } from "../src/oauth/command-code"; import { buildModelsRequest, OAUTH_PROVIDERS } from "../src/oauth"; -import { commandCodeReasoningEfforts, resetCommandCodeReasoningEffortsForTest } from "../src/providers/command-code-efforts"; +import { + commandCodeReasoningEfforts, + refreshCommandCodeReasoningEfforts, + resetCommandCodeReasoningEffortsForTest, +} from "../src/providers/command-code-efforts"; import { PROVIDER_REGISTRY } from "../src/providers/registry"; import type { OcxParsedRequest, OcxProviderConfig } from "../src/types"; import { createTestTranslatorBudget } from "./helpers/translator-budget"; @@ -466,6 +470,22 @@ describe("Command Code provider", () => { expect(JSON.parse(generated[1]!.body!).params).not.toHaveProperty("reasoning_effort"); }); + test("fetches Luna and Gemini effort profiles from their canonical public URLs", async () => { + const urls: string[] = []; + const fetch = (async (url: string | URL | Request) => { + urls.push(String(url)); + return new Response("Reasoning efforts high are supported; no other reasoning settings."); + }) as typeof globalThis.fetch; + + await refreshCommandCodeReasoningEfforts("gpt-5.6-luna", fetch); + await refreshCommandCodeReasoningEfforts("google/gemini-3.7-flash", fetch); + + expect(urls).toEqual([ + "https://commandcode.ai/models/gpt-5-6-luna", + "https://commandcode.ai/models/gemini-3-7-flash", + ]); + }); + test("omits effort when the caller did not choose one", async () => { const built = await builtRequest({ ...parsed("claude-haiku-4-5"), options: { maxOutputTokens: 100 } }); expect(JSON.parse(built.body).params).not.toHaveProperty("reasoning_effort"); diff --git a/tests/commandcode-provider.test.ts b/tests/commandcode-provider.test.ts index bb358bf444..7f9f29495f 100644 --- a/tests/commandcode-provider.test.ts +++ b/tests/commandcode-provider.test.ts @@ -68,6 +68,11 @@ describe("Command Code provider", () => { defaultModel: "deepseek/deepseek-v4-flash", apiKeyValidation: "unknown", reasoningEfforts: [], + modelReasoningEfforts: { + "deepseek/deepseek-v4-flash-vision-exp": ["high", "max"], + "gpt-5.6-luna": ["low", "medium", "high", "xhigh", "max"], + "google/gemini-3.7-flash": ["low", "medium", "high"], + }, modelDiscovery: { path: "models", maxResponseBytes: 256 * 1024, @@ -183,8 +188,8 @@ describe("Command Code provider", () => { const config = withStubbedProviderFetch(commandcodeConfig()); const models = (await gatherRoutedModels(config)).filter(row => row.provider === "commandcode"); - // Full public catalog snapshot: 51 rows, including the free-tier entries. - expect(models).toHaveLength(51); + // Full authenticated catalog snapshot: 60 rows, including the free-tier entries. + expect(models).toHaveLength(60); expect(models.map(row => row.id)).toContain("deepseek/deepseek-v4-flash"); expect(models.map(row => row.id)).toContain("moonshotai/Kimi-K2.7-Code"); expect(models.map(row => row.id)).toContain("poolside/laguna-s-2.1-free"); @@ -202,6 +207,20 @@ describe("Command Code provider", () => { const sol = models.find(row => row.id === "gpt-5.6-sol")!; expect(sol.contextWindow).toBe(1_050_000); + expect(models.find(row => row.id === "deepseek/deepseek-v4-flash-vision-exp")) + .toMatchObject({ + id: "deepseek/deepseek-v4-flash-vision-exp", + reasoningEfforts: ["high", "max"], + }); + expect(models.find(row => row.id === "gpt-5.6-luna")).toMatchObject({ + id: "gpt-5.6-luna", + reasoningEfforts: ["low", "medium", "high", "xhigh", "max"], + }); + expect(models.find(row => row.id === "google/gemini-3.7-flash")).toMatchObject({ + id: "google/gemini-3.7-flash", + reasoningEfforts: ["low", "medium", "high"], + }); + expect(routedSlug("commandcode", deepseek.id)).toBe("commandcode/deepseek-deepseek-v4-flash"); expect(routeModel(config, "commandcode/deepseek/deepseek-v4-flash").modelId) .toBe("deepseek/deepseek-v4-flash"); diff --git a/tests/fixtures/commandcode-models.json b/tests/fixtures/commandcode-models.json index 06b9741358..f50c52c6d8 100644 --- a/tests/fixtures/commandcode-models.json +++ b/tests/fixtures/commandcode-models.json @@ -1 +1 @@ -{"object":"list","data":[{"id":"claude-sonnet-5","object":"model","created":1785728568,"owned_by":"command-code","name":"Claude Sonnet 5","context_length":1000000},{"id":"claude-sonnet-4-6","object":"model","created":1785728568,"owned_by":"command-code","name":"Claude Sonnet 4.6","context_length":1000000},{"id":"claude-fable-5","object":"model","created":1785728568,"owned_by":"command-code","name":"Claude Fable 5","context_length":1000000},{"id":"claude-opus-5","object":"model","created":1785728568,"owned_by":"command-code","name":"Claude Opus 5","context_length":1000000},{"id":"claude-opus-4-8","object":"model","created":1785728568,"owned_by":"command-code","name":"Claude Opus 4.8","context_length":1000000},{"id":"claude-opus-4-7","object":"model","created":1785728568,"owned_by":"command-code","name":"Claude Opus 4.7","context_length":1000000},{"id":"claude-haiku-4-5-20251001","object":"model","created":1785728568,"owned_by":"command-code","name":"Claude Haiku 4.5","context_length":200000},{"id":"gpt-5.6-sol","object":"model","created":1785728568,"owned_by":"command-code","name":"GPT-5.6 Sol","context_length":1050000},{"id":"gpt-5.6-terra","object":"model","created":1785728568,"owned_by":"command-code","name":"GPT-5.6 Terra","context_length":1050000},{"id":"gpt-5.6-luna","object":"model","created":1785728568,"owned_by":"command-code","name":"GPT-5.6 Luna","context_length":1050000},{"id":"gpt-5.5","object":"model","created":1785728568,"owned_by":"command-code","name":"GPT-5.5","context_length":200000},{"id":"gpt-5.4","object":"model","created":1785728568,"owned_by":"command-code","name":"GPT-5.4","context_length":400000},{"id":"gpt-5.3-codex","object":"model","created":1785728568,"owned_by":"command-code","name":"GPT-5.3 Codex","context_length":400000},{"id":"gpt-5.4-mini","object":"model","created":1785728568,"owned_by":"command-code","name":"GPT-5.4 Mini","context_length":400000},{"id":"deepseek/deepseek-v4-pro","object":"model","created":1785728568,"owned_by":"command-code","name":"DeepSeek V4 Pro","context_length":1000000},{"id":"deepseek/deepseek-v4-flash","object":"model","created":1785728568,"owned_by":"command-code","name":"DeepSeek V4 Flash","context_length":1000000},{"id":"moonshotai/Kimi-K3","object":"model","created":1785728568,"owned_by":"command-code","name":"Kimi K3","context_length":1000000},{"id":"moonshotai/Kimi-K2.7-Code","object":"model","created":1785728568,"owned_by":"command-code","name":"Kimi K2.7 Code","context_length":256000},{"id":"moonshotai/Kimi-K2.7-Code-Highspeed","object":"model","created":1785728568,"owned_by":"command-code","name":"Kimi K2.7 Code HighSpeed","context_length":262000},{"id":"moonshotai/Kimi-K2.6","object":"model","created":1785728568,"owned_by":"command-code","name":"Kimi K2.6","context_length":256000},{"id":"moonshotai/Kimi-K2.5","object":"model","created":1785728568,"owned_by":"command-code","name":"Kimi K2.5","context_length":256000},{"id":"zai-org/GLM-5.2","object":"model","created":1785728568,"owned_by":"command-code","name":"GLM-5.2","context_length":1000000},{"id":"zai-org/GLM-5.2-Fast","object":"model","created":1785728568,"owned_by":"command-code","name":"GLM-5.2 Fast","context_length":1000000},{"id":"zai-org/GLM-5.1","object":"model","created":1785728568,"owned_by":"command-code","name":"GLM-5.1","context_length":200000},{"id":"zai-org/GLM-5","object":"model","created":1785728568,"owned_by":"command-code","name":"GLM-5","context_length":200000},{"id":"MiniMaxAI/MiniMax-M3","object":"model","created":1785728568,"owned_by":"command-code","name":"MiniMax M3","context_length":1000000},{"id":"MiniMaxAI/MiniMax-M2.7","object":"model","created":1785728568,"owned_by":"command-code","name":"MiniMax M2.7","context_length":200000},{"id":"MiniMaxAI/MiniMax-M2.5","object":"model","created":1785728568,"owned_by":"command-code","name":"MiniMax M2.5","context_length":200000},{"id":"xiaomi/mimo-v2.5-pro","object":"model","created":1785728568,"owned_by":"command-code","name":"MiMo V2.5 Pro","context_length":1000000},{"id":"xiaomi/mimo-v2.5","object":"model","created":1785728568,"owned_by":"command-code","name":"MiMo V2.5","context_length":1000000},{"id":"Qwen/Qwen3.6-Max-Preview","object":"model","created":1785728568,"owned_by":"command-code","name":"Qwen 3.6 Max Preview","context_length":200000},{"id":"Qwen/Qwen3.6-Plus","object":"model","created":1785728568,"owned_by":"command-code","name":"Qwen 3.6 Plus","context_length":200000},{"id":"Qwen/Qwen3.7-Max","object":"model","created":1785728568,"owned_by":"command-code","name":"Qwen 3.7 Max","context_length":1000000},{"id":"Qwen/Qwen3.7-Plus","object":"model","created":1785728568,"owned_by":"command-code","name":"Qwen 3.7 Plus","context_length":1000000},{"id":"Qwen/Qwen3.7-Flash","object":"model","created":1785728568,"owned_by":"command-code","name":"Qwen 3.7 Flash","context_length":1000000},{"id":"Qwen/Qwen3.8-Max","object":"model","created":1785728568,"owned_by":"command-code","name":"Qwen 3.8 Max","context_length":1000000},{"id":"stepfun/Step-3.7-Flash","object":"model","created":1785728568,"owned_by":"command-code","name":"Step 3.7 Flash","context_length":256000},{"id":"stepfun/Step-3.5-Flash","object":"model","created":1785728568,"owned_by":"command-code","name":"Step 3.5 Flash","context_length":1000000},{"id":"tencent/hy3-paid","object":"model","created":1785728568,"owned_by":"command-code","name":"Tencent Hy3","context_length":262144},{"id":"google/gemini-3.6-flash","object":"model","created":1785728568,"owned_by":"command-code","name":"Gemini 3.6 Flash","context_length":1000000},{"id":"google/gemini-3.5-flash","object":"model","created":1785728568,"owned_by":"command-code","name":"Gemini 3.5 Flash","context_length":1000000},{"id":"google/gemini-3.5-flash-lite","object":"model","created":1785728568,"owned_by":"command-code","name":"Gemini 3.5 Flash Lite","context_length":1000000},{"id":"google/gemini-3.1-flash-lite","object":"model","created":1785728568,"owned_by":"command-code","name":"Gemini 3.1 Flash Lite","context_length":1000000},{"id":"sakana/fugu-ultra","object":"model","created":1785728568,"owned_by":"command-code","name":"Fugu Ultra","context_length":1000000},{"id":"nvidia/nemotron-3-ultra-550b-a55b","object":"model","created":1785728568,"owned_by":"command-code","name":"Nemotron 3 Ultra","context_length":1000000},{"id":"thinkingmachines/inkling","object":"model","created":1785728568,"owned_by":"command-code","name":"Inkling","context_length":256000},{"id":"thinkingmachines/inkling-small","object":"model","created":1785728568,"owned_by":"command-code","name":"Inkling Small","context_length":1000000},{"id":"poolside/laguna-s-2.1-free","object":"model","created":1785728568,"owned_by":"command-code","name":"Laguna S 2.1","context_length":256000},{"id":"inclusionai/ling-3.0-flash-free","object":"model","created":1785728568,"owned_by":"command-code","name":"Ling 3.0 Flash","context_length":256000},{"id":"meta/muse-spark-1.1","object":"model","created":1785728568,"owned_by":"command-code","name":"Muse Spark 1.1","context_length":1048576},{"id":"xai/grok-4.5","object":"model","created":1785728568,"owned_by":"command-code","name":"Grok 4.5","context_length":500000}]} \ No newline at end of file +{"object":"list","data":[{"id":"claude-sonnet-5","object":"model","created":1787739133,"owned_by":"command-code","name":"Claude Sonnet 5","context_length":1000000},{"id":"claude-sonnet-4-6","object":"model","created":1787739133,"owned_by":"command-code","name":"Claude Sonnet 4.6","context_length":1000000},{"id":"claude-fable-5","object":"model","created":1787739133,"owned_by":"command-code","name":"Claude Fable 5","context_length":1000000},{"id":"claude-opus-5","object":"model","created":1787739133,"owned_by":"command-code","name":"Claude Opus 5","context_length":1000000},{"id":"claude-opus-4-8","object":"model","created":1787739133,"owned_by":"command-code","name":"Claude Opus 4.8","context_length":1000000},{"id":"claude-opus-4-7","object":"model","created":1787739133,"owned_by":"command-code","name":"Claude Opus 4.7","context_length":1000000},{"id":"claude-haiku-4-5-20251001","object":"model","created":1787739133,"owned_by":"command-code","name":"Claude Haiku 4.5","context_length":200000},{"id":"gpt-5.6-sol","object":"model","created":1787739133,"owned_by":"command-code","name":"GPT-5.6 Sol","context_length":1050000},{"id":"gpt-5.6-terra","object":"model","created":1787739133,"owned_by":"command-code","name":"GPT-5.6 Terra","context_length":1050000},{"id":"gpt-5.6-luna","object":"model","created":1787739133,"owned_by":"command-code","name":"GPT-5.6 Luna","context_length":1050000},{"id":"gpt-5.5","object":"model","created":1787739133,"owned_by":"command-code","name":"GPT-5.5","context_length":400000},{"id":"gpt-5.4","object":"model","created":1787739133,"owned_by":"command-code","name":"GPT-5.4","context_length":400000},{"id":"gpt-5.3-codex","object":"model","created":1787739133,"owned_by":"command-code","name":"GPT-5.3 Codex","context_length":400000},{"id":"gpt-5.4-mini","object":"model","created":1787739133,"owned_by":"command-code","name":"GPT-5.4 Mini","context_length":400000},{"id":"deepseek/deepseek-v4-pro","object":"model","created":1787739133,"owned_by":"command-code","name":"DeepSeek V4 Pro (latest)","context_length":1000000},{"id":"deepseek/deepseek-v4-flash","object":"model","created":1787739133,"owned_by":"command-code","name":"DeepSeek V4 Flash (latest)","context_length":1000000},{"id":"deepseek/deepseek-v4-flash-vision-exp","object":"model","created":1787739133,"owned_by":"command-code","name":"DeepSeek V4 Flash Vision (exp)","context_length":1000000},{"id":"moonshotai/Kimi-K3","object":"model","created":1787739133,"owned_by":"command-code","name":"Kimi K3","context_length":1000000},{"id":"moonshotai/Kimi-K2.7-Code","object":"model","created":1787739133,"owned_by":"command-code","name":"Kimi K2.7 Code","context_length":256000},{"id":"moonshotai/Kimi-K2.7-Code-Highspeed","object":"model","created":1787739133,"owned_by":"command-code","name":"Kimi K2.7 Code HighSpeed","context_length":262000},{"id":"moonshotai/Kimi-K2.6","object":"model","created":1787739133,"owned_by":"command-code","name":"Kimi K2.6","context_length":256000},{"id":"moonshotai/Kimi-K2.5","object":"model","created":1787739133,"owned_by":"command-code","name":"Kimi K2.5","context_length":256000},{"id":"zai-org/GLM-5.3","object":"model","created":1787739133,"owned_by":"command-code","name":"GLM-5.3","context_length":1000000},{"id":"zai-org/GLM-5.2","object":"model","created":1787739133,"owned_by":"command-code","name":"GLM-5.2","context_length":1000000},{"id":"zai-org/GLM-5.2-Fast","object":"model","created":1787739133,"owned_by":"command-code","name":"GLM-5.2 Fast","context_length":1000000},{"id":"zai-org/GLM-5.1","object":"model","created":1787739133,"owned_by":"command-code","name":"GLM-5.1","context_length":200000},{"id":"zai-org/GLM-5","object":"model","created":1787739133,"owned_by":"command-code","name":"GLM-5","context_length":200000},{"id":"MiniMaxAI/MiniMax-M3","object":"model","created":1787739133,"owned_by":"command-code","name":"MiniMax M3","context_length":1000000},{"id":"MiniMaxAI/MiniMax-M2.7","object":"model","created":1787739133,"owned_by":"command-code","name":"MiniMax M2.7","context_length":200000},{"id":"minimax/minimax-m3-free","object":"model","created":1787739133,"owned_by":"command-code","name":"MiniMax M3","context_length":1000000},{"id":"minimax/minimax-m2.7-free","object":"model","created":1787739133,"owned_by":"command-code","name":"MiniMax M2.7","context_length":197000},{"id":"MiniMaxAI/MiniMax-M2.5","object":"model","created":1787739133,"owned_by":"command-code","name":"MiniMax M2.5","context_length":200000},{"id":"xiaomi/mimo-v2.5-pro","object":"model","created":1787739133,"owned_by":"command-code","name":"MiMo V2.5 Pro","context_length":1000000},{"id":"xiaomi/mimo-v2.5","object":"model","created":1787739133,"owned_by":"command-code","name":"MiMo V2.5","context_length":1000000},{"id":"Qwen/Qwen3.8-Max","object":"model","created":1787739133,"owned_by":"command-code","name":"Qwen 3.8 Max","context_length":1000000},{"id":"Qwen/Qwen3.8-27B","object":"model","created":1787739133,"owned_by":"command-code","name":"Qwen 3.8 27B","context_length":262144},{"id":"Qwen/Qwen3.7-Max","object":"model","created":1787739133,"owned_by":"command-code","name":"Qwen 3.7 Max","context_length":1000000},{"id":"Qwen/Qwen3.7-Plus","object":"model","created":1787739133,"owned_by":"command-code","name":"Qwen 3.7 Plus","context_length":1000000},{"id":"Qwen/Qwen3.7-Flash","object":"model","created":1787739133,"owned_by":"command-code","name":"Qwen 3.7 Flash","context_length":1000000},{"id":"Qwen/Qwen3.6-Max-Preview","object":"model","created":1787739133,"owned_by":"command-code","name":"Qwen 3.6 Max Preview","context_length":200000},{"id":"Qwen/Qwen3.6-Plus","object":"model","created":1787739133,"owned_by":"command-code","name":"Qwen 3.6 Plus","context_length":200000},{"id":"stepfun/Step-3.7-Flash","object":"model","created":1787739133,"owned_by":"command-code","name":"Step 3.7 Flash","context_length":256000},{"id":"stepfun/Step-3.5-Flash","object":"model","created":1787739133,"owned_by":"command-code","name":"Step 3.5 Flash","context_length":1000000},{"id":"tencent/hy3-paid","object":"model","created":1787739133,"owned_by":"command-code","name":"Tencent Hy3","context_length":262144},{"id":"google/gemini-3.7-flash","object":"model","created":1787739133,"owned_by":"command-code","name":"Gemini 3.7 Flash","context_length":1048576},{"id":"google/gemini-3.6-flash","object":"model","created":1787739133,"owned_by":"command-code","name":"Gemini 3.6 Flash","context_length":1000000},{"id":"google/gemini-3.5-flash","object":"model","created":1787739133,"owned_by":"command-code","name":"Gemini 3.5 Flash","context_length":1000000},{"id":"google/gemini-3.5-flash-lite","object":"model","created":1787739133,"owned_by":"command-code","name":"Gemini 3.5 Flash Lite","context_length":1000000},{"id":"google/gemini-3.1-flash-lite","object":"model","created":1787739133,"owned_by":"command-code","name":"Gemini 3.1 Flash Lite","context_length":1000000},{"id":"sakana/fugu-ultra","object":"model","created":1787739133,"owned_by":"command-code","name":"Fugu Ultra","context_length":1000000},{"id":"nvidia/nemotron-3-ultra-550b-a55b","object":"model","created":1787739133,"owned_by":"command-code","name":"Nemotron 3 Ultra","context_length":1000000},{"id":"thinkingmachines/inkling","object":"model","created":1787739133,"owned_by":"command-code","name":"Inkling","context_length":256000},{"id":"thinkingmachines/inkling-small","object":"model","created":1787739133,"owned_by":"command-code","name":"Inkling Small","context_length":1000000},{"id":"stealth/ox-alpha","object":"model","created":1787739133,"owned_by":"command-code","name":"Ox Alpha","context_length":1048576},{"id":"poolside/laguna-s-2.1-free","object":"model","created":1787739133,"owned_by":"command-code","name":"Laguna S 2.1","context_length":256000},{"id":"meta/muse-spark-1.1","object":"model","created":1787739133,"owned_by":"command-code","name":"Muse Spark 1.1","context_length":1048576},{"id":"meta/muse-spark-1.2","object":"model","created":1787739133,"owned_by":"command-code","name":"Muse Spark 1.2","context_length":1048576},{"id":"meta/muse-spark-1.2-contributor","object":"model","created":1787739133,"owned_by":"command-code","name":"Muse Spark 1.2 Contributor","context_length":1048576},{"id":"xai/grok-4.5","object":"model","created":1787739133,"owned_by":"command-code","name":"Grok 4.5","context_length":500000},{"id":"xai/grok-4.6","object":"model","created":1787739133,"owned_by":"command-code","name":"Grok 4.6","context_length":500000}]}