From 2264cffe407c3b3d037abe50514e48dcf130834e Mon Sep 17 00:00:00 2001 From: Webman Date: Sun, 23 Aug 2026 05:00:36 -0500 Subject: [PATCH] fix(ci): finish greening release/v3.8.50 base (#9985, #11203) (#11201) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validated on the combined batch board over tip 8a42aeeb: static gates clean (changelog, file-size 159 frozen, complexity 2621<=2774, cognitive 1181<=1223, dead-code 408<=416), typecheck:core clean, 107 focused tests green. This drains the remaining #9985 tail — the v2 dual-write assertions (guide-settings/t40), the zai→z-ai stale id, the hackclub leftovers, and the #11162 cli-combo models (#11203). Note: guide-settings also trips this devbox's container guard (/.dockerenv present), an environment artifact unrelated to CI. Base is green again. Thank you @jonlwheat2-gif! --- tests/unit/cli-combo-command.test.ts | 16 +++++++++++----- tests/unit/clinepass-provider.test.ts | 2 +- tests/unit/guide-settings-route.test.ts | 6 +++++- tests/unit/provider-alias-uniqueness.test.ts | 3 --- .../t40-opencode-cli-tools-integration.test.ts | 6 +++++- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/tests/unit/cli-combo-command.test.ts b/tests/unit/cli-combo-command.test.ts index 40c3f44f3a..dc38e3349e 100644 --- a/tests/unit/cli-combo-command.test.ts +++ b/tests/unit/cli-combo-command.test.ts @@ -37,7 +37,11 @@ async function withComboEnv(fn: (dataDir: string) => Promise) { test("combo create inserts a new combo via db module", async () => { await withComboEnv(async () => { const { runComboCreateCommand } = await import("../../bin/cli/commands/combo.mjs"); - const result = await runComboCreateCommand("my-combo", "priority", {}); + // #11162: combo create refuses combos without any model — pass a model + // like the sibling tests updated in that commit. + const result = await runComboCreateCommand("my-combo", "priority", { + models: ["openai/gpt-4o-mini"], + }); assert.equal(result, 0); // Verify via the same db module @@ -53,10 +57,12 @@ test("combo create fails if combo already exists", async () => { await withComboEnv(async () => { const { runComboCreateCommand } = await import("../../bin/cli/commands/combo.mjs"); - await runComboCreateCommand("dup-combo", "auto", {}); + await runComboCreateCommand("dup-combo", "auto", { models: ["openai/gpt-4o-mini"] }); const originalError = console.error; console.error = () => {}; - const result = await runComboCreateCommand("dup-combo", "auto", {}); + const result = await runComboCreateCommand("dup-combo", "auto", { + models: ["openai/gpt-4o-mini"], + }); console.error = originalError; assert.equal(result, 1); @@ -68,7 +74,7 @@ test("combo delete removes the combo", async () => { const { runComboCreateCommand, runComboDeleteCommand } = await import("../../bin/cli/commands/combo.mjs"); - await runComboCreateCommand("to-delete", "weighted", {}); + await runComboCreateCommand("to-delete", "weighted", { models: ["openai/gpt-4o-mini"] }); const result = await runComboDeleteCommand("to-delete", { yes: true }); assert.equal(result, 0); @@ -91,7 +97,7 @@ test("combo switch updates active combo when server is offline", async () => { const { runComboCreateCommand, runComboSwitchCommand } = await import("../../bin/cli/commands/combo.mjs"); - await runComboCreateCommand("my-switch", "round-robin", {}); + await runComboCreateCommand("my-switch", "round-robin", { models: ["openai/gpt-4o-mini"] }); const result = await runComboSwitchCommand("my-switch", {}); assert.equal(result, 0); diff --git a/tests/unit/clinepass-provider.test.ts b/tests/unit/clinepass-provider.test.ts index d49957d305..402133896d 100644 --- a/tests/unit/clinepass-provider.test.ts +++ b/tests/unit/clinepass-provider.test.ts @@ -87,7 +87,7 @@ test("ClinePass fallback is the official subscription-only catalog", () => { test("Cline fallback owns recommended/free models and excludes the ClinePass namespace", () => { const ids = providerRegistry.cline.models.map((model: { id: string }) => model.id); assert.deepEqual(ids, [ - "zai/glm-5.2", + "z-ai/glm-5.2", "x-ai/grok-4.5", "openai/gpt-5.6-sol", "moonshotai/kimi-k3", diff --git a/tests/unit/guide-settings-route.test.ts b/tests/unit/guide-settings-route.test.ts index 7516bd0be5..0580a7c9c1 100644 --- a/tests/unit/guide-settings-route.test.ts +++ b/tests/unit/guide-settings-route.test.ts @@ -127,7 +127,11 @@ test("guide-settings POST writes OpenCode config with current schema and multi-m "cc/claude-sonnet-4-20250514", "gg/gemini-2.5-pro", ]); - assert.equal(content.providers, undefined); + // The v2 provider schema is dual-written alongside the v1 block: the v2 + // entry lives under `providers.omniroute` with `package`/`settings`. + assert.equal(content.providers.omniroute.package, "@opencode-ai/ai/providers/openai-compatible"); + assert.equal(content.providers.omniroute.settings.baseURL, "http://my-omni/v1"); + assert.ok(content.providers.omniroute.settings.apiKey.startsWith("sk-")); }); test("guide-settings POST preserves existing OpenCode config fields while only updating provider.omniroute", async () => { diff --git a/tests/unit/provider-alias-uniqueness.test.ts b/tests/unit/provider-alias-uniqueness.test.ts index d093d1186c..7ddeec507e 100644 --- a/tests/unit/provider-alias-uniqueness.test.ts +++ b/tests/unit/provider-alias-uniqueness.test.ts @@ -47,21 +47,18 @@ test("primary providers keep the short alias; web variants use their own id", () assert.equal(PROVIDER_ID_TO_ALIAS["qwen-web"], "qwen-web"); assert.equal(PROVIDER_ID_TO_ALIAS.kimi, "kimi"); assert.equal(PROVIDER_ID_TO_ALIAS["kimi-web"], "kimi-web"); - assert.equal(PROVIDER_ID_TO_ALIAS.hackclub, "hc"); assert.equal(PROVIDER_ID_TO_ALIAS.huggingchat, "huggingchat"); }); test("src/shared providers map resolves the same aliases unambiguously", () => { // alias → id assert.equal(resolveProviderId("kimi"), "kimi"); - assert.equal(resolveProviderId("hc"), "hackclub"); // id used as alias for the secondary variants assert.equal(resolveProviderId("qwen-web"), "qwen-web"); assert.equal(resolveProviderId("kimi-web"), "kimi-web"); assert.equal(resolveProviderId("huggingchat"), "huggingchat"); // id → alias assert.equal(getProviderAlias("kimi"), "kimi"); - assert.equal(getProviderAlias("hackclub"), "hc"); }); // #6673: hailuo-web must not collide with the paid API-key minimax/minimax-cn diff --git a/tests/unit/t40-opencode-cli-tools-integration.test.ts b/tests/unit/t40-opencode-cli-tools-integration.test.ts index c1da020ff9..6401c815d3 100644 --- a/tests/unit/t40-opencode-cli-tools-integration.test.ts +++ b/tests/unit/t40-opencode-cli-tools-integration.test.ts @@ -110,7 +110,11 @@ test("T40: OpenCode config document uses current provider schema", () => { configDocument.provider.omniroute.models["gg/gemini-2.5-pro"].name, "Gemini 2.5 Pro" ); - assert.equal(configDocument.providers, undefined); + // v2 provider schema is dual-written alongside the v1 block. + assert.equal( + configDocument.providers.omniroute.package, + "@opencode-ai/ai/providers/openai-compatible" + ); }); test("T40: OpenCode explicit multi-model selection overrides fallback defaults", () => {