Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/providers/command-code-efforts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
22 changes: 21 additions & 1 deletion tests/command-code-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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");
Expand Down
23 changes: 21 additions & 2 deletions tests/commandcode-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down
Loading
Loading