Skip to content

Commit 66f84a9

Browse files
fix(opencode-go): add current Go models
Co-authored-by: samson1357924 <[email protected]>
1 parent 50c2cc6 commit 66f84a9

3 files changed

Lines changed: 84 additions & 7 deletions

File tree

docs/providers/opencode-go.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ The provider includes:
2828
| ------------------------------- | --------------------- |
2929
| `opencode-go/glm-5` | GLM-5 |
3030
| `opencode-go/glm-5.1` | GLM-5.1 |
31+
| `opencode-go/glm-5.2` | GLM-5.2 |
3132
| `opencode-go/kimi-k2.5` | Kimi K2.5 |
3233
| `opencode-go/kimi-k2.6` | Kimi K2.6 (3x limits) |
34+
| `opencode-go/kimi-k2.7-code` | Kimi K2.7 Code |
3335
| `opencode-go/deepseek-v4-pro` | DeepSeek V4 Pro |
3436
| `opencode-go/deepseek-v4-flash` | DeepSeek V4 Flash |
3537
| `opencode-go/mimo-v2-omni` | MiMo V2 Omni |
@@ -39,6 +41,8 @@ The provider includes:
3941
| `opencode-go/qwen3.5-plus` | Qwen3.5 Plus |
4042
| `opencode-go/qwen3.6-plus` | Qwen3.6 Plus |
4143

44+
GLM-5.2 uses a 1M-token context window and supports up to 131K output tokens.
45+
4246
## Getting started
4347

4448
<Tabs>

extensions/opencode-go/index.test.ts

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ describe("opencode-go provider plugin", () => {
8787
"deepseek-v4-pro",
8888
"glm-5",
8989
"glm-5.1",
90+
"glm-5.2",
9091
"hy3-preview",
9192
"kimi-k2.5",
9293
"kimi-k2.6",
94+
"kimi-k2.7-code",
9395
"mimo-v2-omni",
9496
"mimo-v2.5",
9597
"mimo-v2-pro",
@@ -125,6 +127,20 @@ describe("opencode-go provider plugin", () => {
125127
expect(deepSeekFlash.provider).toBe("opencode-go");
126128
expect(deepSeekFlash.name).toBe("DeepSeek V4 Flash");
127129

130+
const glm52 = requireMapEntry(models, "glm-5.2");
131+
expect(glm52.api).toBe("openai-completions");
132+
expect(glm52.baseUrl).toBe("https://opencode.ai/zen/go/v1");
133+
expect(glm52.input).toEqual(["text"]);
134+
expect(glm52.reasoning).toBe(true);
135+
expect(glm52.contextWindow).toBe(1_000_000);
136+
expect(glm52.maxTokens).toBe(131_072);
137+
expect(glm52.cost).toEqual({
138+
input: 1.4,
139+
output: 4.4,
140+
cacheRead: 0.26,
141+
cacheWrite: 0,
142+
});
143+
128144
const kimi = requireMapEntry(models, "kimi-k2.6");
129145
expect(kimi.api).toBe("openai-completions");
130146
expect(kimi.baseUrl).toBe("https://opencode.ai/zen/go/v1");
@@ -133,6 +149,19 @@ describe("opencode-go provider plugin", () => {
133149
expect(kimi.contextWindow).toBe(262_144);
134150
expect(kimi.maxTokens).toBe(65_536);
135151

152+
const kimiCode = requireMapEntry(models, "kimi-k2.7-code");
153+
expect(kimiCode.api).toBe("openai-completions");
154+
expect(kimiCode.baseUrl).toBe("https://opencode.ai/zen/go/v1");
155+
expect(kimiCode.input).toEqual(["text", "image", "video"]);
156+
expect(kimiCode.contextWindow).toBe(262_144);
157+
expect(kimiCode.maxTokens).toBe(262_144);
158+
expect(kimiCode.cost).toEqual({
159+
input: 0.95,
160+
output: 4,
161+
cacheRead: 0.19,
162+
cacheWrite: 0,
163+
});
164+
136165
const minimax = requireMapEntry(models, "minimax-m2.7");
137166
expect(minimax.api).toBe("anthropic-messages");
138167
expect(minimax.baseUrl).toBe("https://opencode.ai/zen/go");
@@ -220,13 +249,19 @@ describe("opencode-go provider plugin", () => {
220249
throw new Error("expected OpenCode Go static provider");
221250
}
222251
const deepSeekPro = result.provider.models.find((model) => model.id === "deepseek-v4-pro");
252+
const glm52 = result.provider.models.find((model) => model.id === "glm-5.2");
223253

224-
expect(result.provider.models).toHaveLength(18);
254+
expect(result.provider.models).toHaveLength(20);
225255
expect(deepSeekPro).toMatchObject({
226256
provider: "opencode-go",
227257
contextWindow: 1_000_000,
228258
maxTokens: 384_000,
229259
});
260+
expect(glm52).toMatchObject({
261+
provider: "opencode-go",
262+
contextWindow: 1_000_000,
263+
maxTokens: 131_072,
264+
});
230265
});
231266

232267
it("skips live OpenCode Go catalog discovery when no shared key is configured", async () => {
@@ -438,15 +473,15 @@ describe("opencode-go provider plugin", () => {
438473
provider: "opencode-go",
439474
model: {
440475
provider: "opencode-go",
441-
id: "kimi-k2.6",
442-
name: "Kimi K2.6",
476+
id: "kimi-k2.7-code",
477+
name: "Kimi K2.7 Code",
443478
api: "openai-completions",
444479
baseUrl: "https://opencode.ai/zen/go/v1",
445480
reasoning: true,
446-
input: ["text", "image"],
481+
input: ["text", "image", "video"],
447482
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
448483
contextWindow: 262_144,
449-
maxTokens: 65_536,
484+
maxTokens: 262_144,
450485
},
451486
} as never),
452487
"normalized Kimi model",

extensions/opencode-go/provider-catalog.ts

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ const PROVIDER_ID = "opencode-go";
1515

1616
const OPENCODE_GO_OPENAI_BASE_URL = "https://opencode.ai/zen/go/v1";
1717
const OPENCODE_GO_ANTHROPIC_BASE_URL = "https://opencode.ai/zen/go";
18-
const OPENCODE_GO_KIMI_NO_REASONING_MODEL_IDS = new Set(["kimi-k2.5", "kimi-k2.6"]);
18+
const OPENCODE_GO_KIMI_NO_REASONING_MODEL_IDS = new Set([
19+
"kimi-k2.5",
20+
"kimi-k2.6",
21+
"kimi-k2.7-code",
22+
]);
1923
const OPENCODE_GO_MODELS_ENDPOINT = "https://opencode.ai/zen/go/v1/models";
2024
const OPENCODE_GO_MODELS_TIMEOUT_MS = 5_000;
2125
const OPENCODE_GO_MODELS_CACHE_TTL_MS = 60_000;
@@ -24,7 +28,7 @@ type OpencodeGoModelDefinition = ModelDefinitionConfig & {
2428
provider: typeof PROVIDER_ID;
2529
api: NonNullable<ModelDefinitionConfig["api"]>;
2630
baseUrl: string;
27-
input: Array<"text" | "image">;
31+
input: Array<"text" | "image" | "video">;
2832
};
2933

3034
const OPENCODE_GO_MODELS = (
@@ -107,6 +111,23 @@ const OPENCODE_GO_MODELS = (
107111
contextWindow: 202_752,
108112
maxTokens: 32_768,
109113
},
114+
{
115+
id: "glm-5.2",
116+
name: "GLM-5.2",
117+
api: "openai-completions",
118+
provider: PROVIDER_ID,
119+
baseUrl: OPENCODE_GO_OPENAI_BASE_URL,
120+
reasoning: true,
121+
input: ["text"],
122+
cost: {
123+
input: 1.4,
124+
output: 4.4,
125+
cacheRead: 0.26,
126+
cacheWrite: 0,
127+
},
128+
contextWindow: 1_000_000,
129+
maxTokens: 131_072,
130+
},
110131
{
111132
id: "hy3-preview",
112133
name: "HY3 Preview",
@@ -158,6 +179,23 @@ const OPENCODE_GO_MODELS = (
158179
contextWindow: 262_144,
159180
maxTokens: 65_536,
160181
},
182+
{
183+
id: "kimi-k2.7-code",
184+
name: "Kimi K2.7 Code",
185+
api: "openai-completions",
186+
provider: PROVIDER_ID,
187+
baseUrl: OPENCODE_GO_OPENAI_BASE_URL,
188+
reasoning: true,
189+
input: ["text", "image", "video"],
190+
cost: {
191+
input: 0.95,
192+
output: 4,
193+
cacheRead: 0.19,
194+
cacheWrite: 0,
195+
},
196+
contextWindow: 262_144,
197+
maxTokens: 262_144,
198+
},
161199
{
162200
id: "mimo-v2-omni",
163201
name: "MiMo V2 Omni",

0 commit comments

Comments
 (0)