mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-30 10:25:05 +08:00
feat(presets): upgrade default models to Opus 5, GPT-5.6 Sol and Gemini 3.6 Flash
Bump the default model IDs across every preset file and the downstream defaults that mirror them: - claude-opus-4-8 / anthropic/claude-opus-4.8 / global.anthropic.claude-opus-4-8 -> claude-opus-5, covering all three naming forms - gpt-5.5 and the bare gpt-5.6 -> gpt-5.6-sol - gemini-3.5-flash -> gemini-3.6-flash Add gemini-3.6-flash to the built-in pricing seed (1.50 in / 7.50 out / 0.15 cache read per million). The seed runs INSERT OR IGNORE on every startup, so existing databases pick the row up without overriding prices the user edited by hand. Advance the Claude Desktop opus route ID in step with the frontend SSOT: CURRENT_OPUS_ROUTE_ID becomes claude-opus-5 and claude-opus-4-8 takes over the LEGACY slot, so route IDs stored in existing user configs still resolve through is_compatible_opus_route_alias. Also sync omo.ts recommendations, form placeholders, the SudoCode partner blurb and all four locales, plus the preset assertions that pin these IDs.
This commit is contained in:
@@ -206,7 +206,7 @@ describe("ClaudeDesktopProviderForm", () => {
|
||||
model: "upstream-old",
|
||||
labelOverride: "upstream-old",
|
||||
},
|
||||
"claude-opus-4-8": { model: "upstream-old" },
|
||||
"claude-opus-5": { model: "upstream-old" },
|
||||
"claude-fable-5": { model: "upstream-old" },
|
||||
"claude-haiku-4-5": { model: "upstream-old" },
|
||||
});
|
||||
@@ -214,7 +214,7 @@ describe("ClaudeDesktopProviderForm", () => {
|
||||
[
|
||||
"claude-fable-5",
|
||||
"claude-haiku-4-5",
|
||||
"claude-opus-4-8",
|
||||
"claude-opus-5",
|
||||
"claude-sonnet-5",
|
||||
],
|
||||
);
|
||||
@@ -250,7 +250,7 @@ describe("ClaudeDesktopProviderForm", () => {
|
||||
model: "deepseek-v4-pro",
|
||||
supports1m: true,
|
||||
});
|
||||
expect(routes["claude-opus-4-8"]).toMatchObject({
|
||||
expect(routes["claude-opus-5"]).toMatchObject({
|
||||
model: "deepseek-v4-pro",
|
||||
supports1m: true,
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ describe("AWS Bedrock OpenCode Provider Presets", () => {
|
||||
expect(variants.length).toBeGreaterThan(0);
|
||||
|
||||
const opusModel = variants.find((v) =>
|
||||
v.id.includes("anthropic.claude-opus-4-8"),
|
||||
v.id.includes("anthropic.claude-opus-5"),
|
||||
);
|
||||
expect(opusModel).toBeDefined();
|
||||
});
|
||||
|
||||
@@ -40,7 +40,7 @@ describe("SubRouter provider presets", () => {
|
||||
expect(preset?.endpointCandidates).toEqual(["https://subrouter.ai/v1"]);
|
||||
expect(preset?.auth).toEqual({ OPENAI_API_KEY: "" });
|
||||
expect(preset?.config).toContain('name = "subrouter"');
|
||||
expect(preset?.config).toContain('model = "gpt-5.5"');
|
||||
expect(preset?.config).toContain('model = "gpt-5.6-sol"');
|
||||
expect(preset?.config).toContain('base_url = "https://subrouter.ai/v1"');
|
||||
expect(preset?.config).toContain('wire_api = "responses"');
|
||||
});
|
||||
@@ -53,11 +53,11 @@ describe("SubRouter provider presets", () => {
|
||||
expect(preset).toBeDefined();
|
||||
expect(preset?.baseURL).toBe("https://subrouter.ai/v1beta");
|
||||
expect(preset?.endpointCandidates).toEqual(["https://subrouter.ai/v1beta"]);
|
||||
expect(preset?.model).toBe("gemini-3.5-flash");
|
||||
expect(preset?.model).toBe("gemini-3.6-flash");
|
||||
|
||||
const env = (preset?.settingsConfig as { env: Record<string, string> }).env;
|
||||
expect(env.GOOGLE_GEMINI_BASE_URL).toBe("https://subrouter.ai/v1beta");
|
||||
expect(env.GEMINI_MODEL).toBe("gemini-3.5-flash");
|
||||
expect(env.GEMINI_MODEL).toBe("gemini-3.6-flash");
|
||||
});
|
||||
|
||||
it("uses OpenAI-compatible config for OpenCode", () => {
|
||||
@@ -71,7 +71,7 @@ describe("SubRouter provider presets", () => {
|
||||
"https://subrouter.ai/v1",
|
||||
);
|
||||
expect(preset?.settingsConfig.options?.apiKey).toBe("");
|
||||
expect(preset?.settingsConfig.models).toHaveProperty("gpt-5.5");
|
||||
expect(preset?.settingsConfig.models).toHaveProperty("gpt-5.6-sol");
|
||||
});
|
||||
|
||||
it("uses OpenAI completions config for OpenClaw without hardcoded pricing", () => {
|
||||
@@ -84,13 +84,13 @@ describe("SubRouter provider presets", () => {
|
||||
expect(preset?.settingsConfig.baseUrl).toBe("https://subrouter.ai/v1");
|
||||
expect(preset?.settingsConfig.api).toBe("openai-completions");
|
||||
expect(model).toMatchObject({
|
||||
id: "gpt-5.5",
|
||||
name: "GPT-5.5",
|
||||
id: "gpt-5.6-sol",
|
||||
name: "GPT-5.6 Sol",
|
||||
contextWindow: 400000,
|
||||
});
|
||||
expect(model).not.toHaveProperty("cost");
|
||||
expect(preset?.suggestedDefaults?.model).toEqual({
|
||||
primary: "subrouter/gpt-5.5",
|
||||
primary: "subrouter/gpt-5.6-sol",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -107,7 +107,7 @@ describe("SubRouter provider presets", () => {
|
||||
api_mode: "chat_completions",
|
||||
});
|
||||
expect(preset?.suggestedDefaults?.model).toEqual({
|
||||
default: "gpt-5.5",
|
||||
default: "gpt-5.6-sol",
|
||||
provider: "subrouter",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,8 +23,8 @@ describe("TheRouter OpenCode and OpenClaw presets", () => {
|
||||
expect(preset?.settingsConfig.options?.setCacheKey).toBe(true);
|
||||
expect(models).toHaveProperty("openai/gpt-5.3-codex");
|
||||
expect(models).toHaveProperty("anthropic/claude-sonnet-5");
|
||||
expect(models).toHaveProperty("google/gemini-3.5-flash");
|
||||
expect(models["google/gemini-3.5-flash"]?.name).toBe("Gemini 3.5 Flash");
|
||||
expect(models).toHaveProperty("google/gemini-3.6-flash");
|
||||
expect(models["google/gemini-3.6-flash"]?.name).toBe("Gemini 3.6 Flash");
|
||||
});
|
||||
|
||||
it("uses OpenAI completions config for OpenClaw", () => {
|
||||
@@ -45,20 +45,20 @@ describe("TheRouter OpenCode and OpenClaw presets", () => {
|
||||
"anthropic/claude-sonnet-5",
|
||||
"openai/gpt-5.3-codex",
|
||||
"openai/gpt-5.2",
|
||||
"google/gemini-3.5-flash",
|
||||
"google/gemini-3.6-flash",
|
||||
]),
|
||||
);
|
||||
expect(
|
||||
openClawModels.find((model) => model.id === "google/gemini-3.5-flash"),
|
||||
openClawModels.find((model) => model.id === "google/gemini-3.6-flash"),
|
||||
).toMatchObject({
|
||||
name: "Gemini 3.5 Flash",
|
||||
name: "Gemini 3.6 Flash",
|
||||
cost: { input: 1.5, output: 9, cacheRead: 0.15 },
|
||||
});
|
||||
expect(preset?.suggestedDefaults?.model).toEqual({
|
||||
primary: "therouter/anthropic/claude-sonnet-5",
|
||||
fallbacks: [
|
||||
"therouter/openai/gpt-5.2",
|
||||
"therouter/google/gemini-3.5-flash",
|
||||
"therouter/google/gemini-3.6-flash",
|
||||
],
|
||||
});
|
||||
});
|
||||
@@ -67,13 +67,13 @@ describe("TheRouter OpenCode and OpenClaw presets", () => {
|
||||
const googleModels = OPENCODE_PRESET_MODEL_VARIANTS["@ai-sdk/google"];
|
||||
const ids = googleModels.map((model) => model.id);
|
||||
const geminiFlashModels = googleModels.filter(
|
||||
(model) => model.id === "gemini-3.5-flash",
|
||||
(model) => model.id === "gemini-3.6-flash",
|
||||
);
|
||||
|
||||
expect(new Set(ids).size).toBe(ids.length);
|
||||
expect(geminiFlashModels).toHaveLength(1);
|
||||
expect(geminiFlashModels[0]).toMatchObject({
|
||||
name: "Gemini 3.5 Flash",
|
||||
name: "Gemini 3.6 Flash",
|
||||
variants: {
|
||||
minimal: expect.any(Object),
|
||||
low: expect.any(Object),
|
||||
|
||||
@@ -24,7 +24,7 @@ describe("TheRouter provider presets", () => {
|
||||
expect(env.ANTHROPIC_DEFAULT_SONNET_MODEL).toBe(
|
||||
"anthropic/claude-sonnet-5",
|
||||
);
|
||||
expect(env.ANTHROPIC_DEFAULT_OPUS_MODEL).toBe("anthropic/claude-opus-4.8");
|
||||
expect(env.ANTHROPIC_DEFAULT_OPUS_MODEL).toBe("anthropic/claude-opus-5");
|
||||
});
|
||||
|
||||
it("uses the OpenAI-compatible v1 endpoint for Codex", () => {
|
||||
@@ -60,10 +60,10 @@ describe("TheRouter provider presets", () => {
|
||||
expect(preset?.category).toBe("aggregator");
|
||||
expect(preset?.endpointCandidates).toEqual(["https://api.therouter.ai"]);
|
||||
expect(preset?.baseURL).toBe("https://api.therouter.ai");
|
||||
expect(preset?.model).toBe("gemini-3.5-flash");
|
||||
expect(preset?.model).toBe("gemini-3.6-flash");
|
||||
|
||||
const env = (preset?.settingsConfig as { env: Record<string, string> }).env;
|
||||
expect(env.GOOGLE_GEMINI_BASE_URL).toBe("https://api.therouter.ai");
|
||||
expect(env.GEMINI_MODEL).toBe("gemini-3.5-flash");
|
||||
expect(env.GEMINI_MODEL).toBe("gemini-3.6-flash");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user