
























@@ -1,3 +1,4 @@
1+import { getModels } from "@mariozechner/pi-ai";
12import { describe, expect, it } from "vitest";
23import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
34import { expectPassthroughReplayPolicy } from "../../test/helpers/provider-replay-policy.ts";
@@ -21,6 +22,55 @@ describe("opencode-go provider plugin", () => {
2122});
2223});
232425+it("leaves OpenCode Go models to Pi's built-in registry", async () => {
26+const provider = await registerSingleProviderPlugin(plugin);
27+expect(provider.catalog).toBeUndefined();
28+29+const models = new Map(getModels("opencode-go").map((model) => [model.id, model]));
30+expect([...models.keys()]).toEqual([
31+"glm-5",
32+"glm-5.1",
33+"kimi-k2.5",
34+"kimi-k2.6",
35+"mimo-v2-omni",
36+"mimo-v2-pro",
37+"minimax-m2.5",
38+"minimax-m2.7",
39+"qwen3.5-plus",
40+"qwen3.6-plus",
41+]);
42+43+expect(models.get("kimi-k2.6")).toMatchObject({
44+api: "openai-completions",
45+baseUrl: "https://opencode.ai/zen/go/v1",
46+input: ["text", "image"],
47+reasoning: true,
48+contextWindow: 262_144,
49+maxTokens: 65_536,
50+});
51+expect(models.get("minimax-m2.7")).toMatchObject({
52+api: "anthropic-messages",
53+baseUrl: "https://opencode.ai/zen/go",
54+reasoning: true,
55+contextWindow: 204_800,
56+maxTokens: 131_072,
57+});
58+expect(models.get("mimo-v2-pro")).toMatchObject({
59+api: "openai-completions",
60+baseUrl: "https://opencode.ai/zen/go/v1",
61+input: ["text"],
62+reasoning: true,
63+contextWindow: 1_048_576,
64+maxTokens: 64_000,
65+});
66+expect(models.get("mimo-v2-omni")).toMatchObject({
67+input: ["text", "image"],
68+reasoning: true,
69+contextWindow: 262_144,
70+maxTokens: 64_000,
71+});
72+});
73+2474it("canonicalizes stale OpenCode Go base URLs", async () => {
2575const provider = await registerSingleProviderPlugin(plugin);
2676此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。