feat(opencode-go): register 4 missing models from upstream catalog

Add qwen3.7-max, mimo-v2-pro, mimo-v2-omni, hy3-preview to the
opencode-go provider. Extend executor tests and model specs.

- Registry now matches live https://opencode.ai/zen/go/v1/models response
  (16 models). Previously, four models returned by the upstream API were
  absent from the static registry, so requests to them failed model
  resolution before reaching the executor.
- qwen3.7-max: inherits defaultContextLength 200000; model spec mirrors
  qwen3.6-plus (Bailian multimodal, thinking + tools + vision).
- mimo-v2-pro: spec mirrors mimo-v2-omni (262144 ctx, 131072 maxOut,
  tools + vision).
- mimo-v2-omni: registry entry only (spec already present upstream).
- hy3-preview: registry entry only; falls back to __default__ spec.
- All four route to /chat/completions (default openai format), matching
  the existing opencode-go executor behavior.
This commit is contained in:
Jefersson Lemes
2026-05-27 10:20:25 -03:00
parent f8e726fd1c
commit e9ead52a42
3 changed files with 43 additions and 0 deletions

View File

@@ -1288,10 +1288,14 @@ export const REGISTRY: Record<string, RegistryEntry> = {
{ id: "kimi-k2.5", name: "Kimi K2.5" },
{ id: "mimo-v2.5-pro", name: "MiMo-V2.5-Pro" },
{ id: "mimo-v2.5", name: "MiMo-V2.5" },
{ id: "mimo-v2-pro", name: "MiMo-V2-Pro" },
{ id: "mimo-v2-omni", name: "MiMo-V2-Omni" },
{ id: "minimax-m2.7", name: "MiniMax M2.7", targetFormat: "claude" },
{ id: "minimax-m2.5", name: "MiniMax M2.5", targetFormat: "claude" },
{ id: "qwen3.7-max", name: "Qwen3.7 Max" },
{ id: "qwen3.6-plus", name: "Qwen3.6 Plus" },
{ id: "qwen3.5-plus", name: "Qwen3.5 Plus" },
{ id: "hy3-preview", name: "Hunyuan3 Preview" },
{ id: "deepseek-v4-pro", name: "DeepSeek V4 Pro", supportsReasoning: true },
{ id: "deepseek-v4-flash", name: "DeepSeek V4 Flash", supportsReasoning: true },
],

View File

@@ -217,6 +217,15 @@ export const MODEL_SPECS: Record<string, ModelSpec> = {
aliases: ["kimi-k2.6-thinking", "kimi-for-coding"],
},
// ── Qwen3.7 Max (Bailian multimodal — text/image/video) ─────────
"qwen3.7-max": {
maxOutputTokens: 8192,
contextWindow: 200000,
supportsThinking: true,
supportsTools: true,
supportsVision: true,
},
// ── Xiaomi MiMo V2.5 (1M context, consensus across 7+ sync sources) ──
"mimo-v2.5-pro": {
maxOutputTokens: 131072,
@@ -230,6 +239,12 @@ export const MODEL_SPECS: Record<string, ModelSpec> = {
supportsTools: true,
supportsVision: true,
},
"mimo-v2-pro": {
maxOutputTokens: 131072,
contextWindow: 262144,
supportsTools: true,
supportsVision: true,
},
"mimo-v2-omni": {
maxOutputTokens: 131072,
contextWindow: 262144,

View File

@@ -253,6 +253,30 @@ describe("OpencodeExecutor", () => {
});
assert.deepEqual(fetchCalls[0].options.headers, result.headers);
});
it("routes opencode-go catalog-only models to chat completions", async () => {
// Register new models
registerModel("opencode-go", { id: "qwen3.7-max", name: "Qwen3.7 Max" });
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: "hy3-preview", name: "Hunyuan3 Preview" });
// qwen3.7-max
const qwen37 = await goExecutor.execute(createInput("qwen3.7-max"));
assert.equal(qwen37.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");
// hy3-preview
const hy3 = await goExecutor.execute(createInput("hy3-preview"));
assert.equal(hy3.url, "https://opencode.ai/zen/go/v1/chat/completions");
});
});
describe("user-agent forwarding", () => {