From 9bd7cb7d00207fb04fdf42e5f634fb9ed7b21af8 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 23 Apr 2026 00:25:49 +0900 Subject: [PATCH] feat(opencode-go): register 6 missing models from upstream catalog (#1510) Integrated into release/v3.7.0 --- open-sse/config/providerRegistry.ts | 6 ++++ tests/unit/opencode-executor.test.ts | 47 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/open-sse/config/providerRegistry.ts b/open-sse/config/providerRegistry.ts index f6e4e92ea1..805c3f1324 100644 --- a/open-sse/config/providerRegistry.ts +++ b/open-sse/config/providerRegistry.ts @@ -651,8 +651,14 @@ export const REGISTRY: Record = { authPrefix: "Bearer", defaultContextLength: 200000, models: [ + { id: "glm-5.1", name: "GLM-5.1", contextLength: 204800 }, { id: "glm-5", name: "GLM-5" }, + { id: "kimi-k2.6", name: "Kimi K2.6" }, { id: "kimi-k2.5", name: "Kimi K2.5" }, + { id: "mimo-v2-pro", name: "MiMo V2 Pro" }, + { id: "mimo-v2-omni", name: "MiMo V2 Omni" }, + { id: "qwen3.6-plus", name: "Qwen 3.6 Plus" }, + { id: "qwen3.5-plus", name: "Qwen 3.5 Plus" }, { id: "minimax-m2.7", name: "MiniMax M2.7", targetFormat: "claude" }, { id: "minimax-m2.5", name: "MiniMax M2.5", targetFormat: "claude" }, ], diff --git a/tests/unit/opencode-executor.test.ts b/tests/unit/opencode-executor.test.ts index 8859eb6404..ca333b6551 100644 --- a/tests/unit/opencode-executor.test.ts +++ b/tests/unit/opencode-executor.test.ts @@ -185,5 +185,52 @@ describe("OpencodeExecutor", () => { }); assert.deepEqual(fetchCalls[0].options.headers, result.headers); }); + + it("routes opencode-go new models to chat completions", async () => { + // Register new models + registerModel("opencode-go", { id: "glm-5.1", name: "GLM-5.1", contextLength: 204800 }); + registerModel("opencode-go", { id: "kimi-k2.6", name: "Kimi K2.6" }); + registerModel("opencode-go", { id: "mimo-v2-pro", name: "MiMo V2 Pro" }); + registerModel("opencode-go", { id: "mimo-v2-omni", name: "MiMo V2 Omni" }); + registerModel("opencode-go", { id: "qwen3.6-plus", name: "Qwen 3.6 Plus" }); + registerModel("opencode-go", { id: "qwen3.5-plus", name: "Qwen 3.5 Plus" }); + + // glm-5.1 + const glm51 = await goExecutor.execute(createInput("glm-5.1")); + assert.equal(glm51.url, "https://opencode.ai/zen/go/v1/chat/completions"); + + // kimi-k2.6 + const kimi26 = await goExecutor.execute(createInput("kimi-k2.6")); + assert.equal(kimi26.url, "https://opencode.ai/zen/go/v1/chat/completions"); + + // mimo-v2-pro + const mimoPro = await goExecutor.execute(createInput("mimo-v2-pro")); + assert.equal(mimoPro.url, "https://opencode.ai/zen/go/v1/chat/completions"); + + // mimo-v2-omni + const mimoOmni = await goExecutor.execute(createInput("mimo-v2-omni")); + assert.equal(mimoOmni.url, "https://opencode.ai/zen/go/v1/chat/completions"); + + // qwen3.6-plus + const qwen36 = await goExecutor.execute(createInput("qwen3.6-plus")); + assert.equal(qwen36.url, "https://opencode.ai/zen/go/v1/chat/completions"); + + // qwen3.5-plus + const qwen35 = await goExecutor.execute(createInput("qwen3.5-plus")); + assert.equal(qwen35.url, "https://opencode.ai/zen/go/v1/chat/completions"); + }); + + it("builds bearer auth headers for opencode-go openai models", async () => { + registerModel("opencode-go", { id: "glm-5.1", name: "GLM-5.1" }); + + const result = await goExecutor.execute(createInput("glm-5.1")); + + assert.deepEqual(result.headers, { + Authorization: "Bearer test-key", + "Content-Type": "application/json", + Accept: "text/event-stream", + }); + assert.deepEqual(fetchCalls[0].options.headers, result.headers); + }); }); });