Skip to content

Commit 390be81

Browse files
committed
fix: add OpenCode Go DeepSeek V4 models
1 parent 0d274ef commit 390be81

7 files changed

Lines changed: 170 additions & 18 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Docs: https://docs.openclaw.ai
3838
- Control UI/Quick Settings: persist the assistant avatar override to browser local storage (mirroring the user avatar) so uploaded image data URLs no longer fail config validation with "Too big: expected string to have <=200 characters". Also lift the gateway-side `ui.assistant.avatar` length cap to match the user avatar size budget for non-UI clients writing the field directly. Thanks @BunsDev.
3939
- Browser/CDP: make readiness diagnostics use the same discovery-first fallback as reachability for bare `ws://` Browserless and Browserbase CDP URLs. Fixes #69532.
4040
- ACP/OpenCode: update the bundled acpx runtime to 0.6.0 and cover the OpenCode ACP bind path in Docker live tests.
41+
- Providers/OpenCode Go: add DeepSeek V4 Pro and DeepSeek V4 Flash to the Go catalog while the bundled Pi registry catches up. Fixes #71587.
4142
- Browser/existing-session: support per-profile Chrome MCP command/args, map `cdpUrl` to `--browserUrl` or `--wsEndpoint`, and avoid combining endpoint flags with `--userDataDir`. Fixes #47879, #48037, and #62706. Thanks @puneet1409, @zhehao, and @madkow1001.
4243
- Media/plugins: bound MIME sniffing and ZIP archive preflight before handing
4344
untrusted files to `file-type` or `jszip`, reducing parser CPU and memory

‎docs/providers/opencode-go.md‎

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,26 @@ provider id `opencode-go` so upstream per-model routing stays correct.
1818

1919
## Built-in catalog
2020

21-
OpenClaw sources the Go catalog from the bundled pi model registry. Run
21+
OpenClaw sources most Go catalog rows from the bundled pi model registry and
22+
supplements current upstream rows while the registry catches up. Run
2223
`openclaw models list --provider opencode-go` for the current model list.
2324

24-
As of the bundled pi catalog, the provider includes:
25-
26-
| Model ref | Name |
27-
| -------------------------- | --------------------- |
28-
| `opencode-go/glm-5` | GLM-5 |
29-
| `opencode-go/glm-5.1` | GLM-5.1 |
30-
| `opencode-go/kimi-k2.5` | Kimi K2.5 |
31-
| `opencode-go/kimi-k2.6` | Kimi K2.6 (3x limits) |
32-
| `opencode-go/mimo-v2-omni` | MiMo V2 Omni |
33-
| `opencode-go/mimo-v2-pro` | MiMo V2 Pro |
34-
| `opencode-go/minimax-m2.5` | MiniMax M2.5 |
35-
| `opencode-go/minimax-m2.7` | MiniMax M2.7 |
36-
| `opencode-go/qwen3.5-plus` | Qwen3.5 Plus |
37-
| `opencode-go/qwen3.6-plus` | Qwen3.6 Plus |
25+
The provider includes:
26+
27+
| Model ref | Name |
28+
| ------------------------------- | --------------------- |
29+
| `opencode-go/glm-5` | GLM-5 |
30+
| `opencode-go/glm-5.1` | GLM-5.1 |
31+
| `opencode-go/kimi-k2.5` | Kimi K2.5 |
32+
| `opencode-go/kimi-k2.6` | Kimi K2.6 (3x limits) |
33+
| `opencode-go/deepseek-v4-pro` | DeepSeek V4 Pro |
34+
| `opencode-go/deepseek-v4-flash` | DeepSeek V4 Flash |
35+
| `opencode-go/mimo-v2-omni` | MiMo V2 Omni |
36+
| `opencode-go/mimo-v2-pro` | MiMo V2 Pro |
37+
| `opencode-go/minimax-m2.5` | MiniMax M2.5 |
38+
| `opencode-go/minimax-m2.7` | MiniMax M2.7 |
39+
| `opencode-go/qwen3.5-plus` | Qwen3.5 Plus |
40+
| `opencode-go/qwen3.6-plus` | Qwen3.6 Plus |
3841

3942
## Getting started
4043

‎extensions/opencode-go/index.test.ts‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe("opencode-go provider plugin", () => {
4343
});
4444
});
4545

46-
it("leaves OpenCode Go models to Pi's built-in registry", async () => {
46+
it("keeps OpenCode Go catalog coverage aligned with upstream", async () => {
4747
const provider = await registerSingleProviderPlugin(plugin);
4848
expect(provider.catalog).toBeUndefined();
4949

@@ -62,6 +62,27 @@ describe("opencode-go provider plugin", () => {
6262
"qwen3.5-plus",
6363
"qwen3.6-plus",
6464
]);
65+
const supplemental = await provider.augmentModelCatalog?.({
66+
entries: [...models.values()].map((model) => ({
67+
provider: model.provider,
68+
id: model.id,
69+
name: model.name,
70+
})),
71+
} as never);
72+
expect(supplemental).toEqual(
73+
expect.arrayContaining([
74+
expect.objectContaining({
75+
provider: "opencode-go",
76+
id: "deepseek-v4-pro",
77+
name: "DeepSeek V4 Pro",
78+
}),
79+
expect.objectContaining({
80+
provider: "opencode-go",
81+
id: "deepseek-v4-flash",
82+
name: "DeepSeek V4 Flash",
83+
}),
84+
]),
85+
);
6586

6687
expect(models.get("kimi-k2.6")).toMatchObject({
6788
api: "openai-completions",
@@ -92,6 +113,19 @@ describe("opencode-go provider plugin", () => {
92113
contextWindow: 262_144,
93114
maxTokens: 128_000,
94115
});
116+
expect(
117+
provider.resolveDynamicModel?.({
118+
modelId: "deepseek-v4-pro",
119+
} as never),
120+
).toMatchObject({
121+
id: "deepseek-v4-pro",
122+
api: "anthropic-messages",
123+
provider: "opencode-go",
124+
baseUrl: "https://opencode.ai/zen/go",
125+
reasoning: true,
126+
contextWindow: 1_000_000,
127+
maxTokens: 384_000,
128+
});
95129
});
96130

97131
it("canonicalizes stale OpenCode Go base URLs", async () => {

‎extensions/opencode-go/index.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
33
import { PASSTHROUGH_GEMINI_REPLAY_HOOKS } from "openclaw/plugin-sdk/provider-model-shared";
44
import { applyOpencodeGoConfig, OPENCODE_GO_DEFAULT_MODEL_REF } from "./api.js";
55
import { opencodeGoMediaUnderstandingProvider } from "./media-understanding-provider.js";
6-
import { normalizeOpencodeGoBaseUrl } from "./provider-catalog.js";
6+
import {
7+
listOpencodeGoSupplementalModelCatalogEntries,
8+
normalizeOpencodeGoBaseUrl,
9+
resolveOpencodeGoSupplementalModel,
10+
} from "./provider-catalog.js";
711

812
const PROVIDER_ID = "opencode-go";
913
export default definePluginEntry({
@@ -60,6 +64,8 @@ export default definePluginEntry({
6064
}
6165
: undefined;
6266
},
67+
resolveDynamicModel: ({ modelId }) => resolveOpencodeGoSupplementalModel(modelId),
68+
augmentModelCatalog: () => listOpencodeGoSupplementalModelCatalogEntries(),
6369
...PASSTHROUGH_GEMINI_REPLAY_HOOKS,
6470
isModernModelRef: () => true,
6571
});

‎extensions/opencode-go/provider-catalog.ts‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,69 @@
1+
import type { ModelCatalogEntry } from "openclaw/plugin-sdk/agent-runtime";
2+
import type { ProviderRuntimeModel } from "openclaw/plugin-sdk/plugin-entry";
3+
import { normalizeModelCompat } from "openclaw/plugin-sdk/provider-model-shared";
4+
5+
const PROVIDER_ID = "opencode-go";
6+
17
export const OPENCODE_GO_OPENAI_BASE_URL = "https://opencode.ai/zen/go/v1";
28
export const OPENCODE_GO_ANTHROPIC_BASE_URL = "https://opencode.ai/zen/go";
39

10+
const OPENCODE_GO_SUPPLEMENTAL_MODELS = (
11+
[
12+
{
13+
id: "deepseek-v4-pro",
14+
name: "DeepSeek V4 Pro",
15+
api: "anthropic-messages",
16+
provider: PROVIDER_ID,
17+
baseUrl: OPENCODE_GO_ANTHROPIC_BASE_URL,
18+
reasoning: true,
19+
input: ["text"],
20+
cost: {
21+
input: 1.74,
22+
output: 3.48,
23+
cacheRead: 0.145,
24+
cacheWrite: 0,
25+
},
26+
contextWindow: 1_000_000,
27+
maxTokens: 384_000,
28+
},
29+
{
30+
id: "deepseek-v4-flash",
31+
name: "DeepSeek V4 Flash",
32+
api: "anthropic-messages",
33+
provider: PROVIDER_ID,
34+
baseUrl: OPENCODE_GO_ANTHROPIC_BASE_URL,
35+
reasoning: true,
36+
input: ["text"],
37+
cost: {
38+
input: 0.14,
39+
output: 0.28,
40+
cacheRead: 0.028,
41+
cacheWrite: 0,
42+
},
43+
contextWindow: 1_000_000,
44+
maxTokens: 384_000,
45+
},
46+
] satisfies ProviderRuntimeModel[]
47+
).map((model) => normalizeModelCompat(model));
48+
49+
export function listOpencodeGoSupplementalModelCatalogEntries(): ModelCatalogEntry[] {
50+
return OPENCODE_GO_SUPPLEMENTAL_MODELS.map((model) => ({
51+
provider: model.provider,
52+
id: model.id,
53+
name: model.name,
54+
reasoning: model.reasoning,
55+
input: model.input,
56+
contextWindow: model.contextWindow,
57+
}));
58+
}
59+
60+
export function resolveOpencodeGoSupplementalModel(
61+
modelId: string,
62+
): ProviderRuntimeModel | undefined {
63+
const normalizedModelId = modelId.trim().toLowerCase();
64+
return OPENCODE_GO_SUPPLEMENTAL_MODELS.find((model) => model.id === normalizedModelId);
65+
}
66+
467
function normalizeBaseUrl(baseUrl: string | undefined): string {
568
return (baseUrl ?? "").trim().replace(/\/+$/, "");
669
}

‎src/commands/models/list.list-command.forward-compat.test.ts‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,51 @@ describe("modelsListCommand forward-compat", () => {
528528
);
529529
});
530530

531+
it("includes provider-owned supplemental catalog rows with provider filters", async () => {
532+
mocks.resolveConfiguredEntries.mockReturnValueOnce({ entries: [] });
533+
mocks.loadModelRegistry.mockResolvedValueOnce({
534+
models: [],
535+
availableKeys: new Set(["opencode-go/deepseek-v4-pro"]),
536+
registry: {
537+
getAll: () => [],
538+
},
539+
});
540+
mocks.loadModelCatalog.mockResolvedValueOnce([
541+
{
542+
provider: "opencode-go",
543+
id: "deepseek-v4-pro",
544+
name: "DeepSeek V4 Pro",
545+
input: ["text"],
546+
contextWindow: 1_000_000,
547+
},
548+
]);
549+
mocks.resolveModelWithRegistry.mockImplementation(
550+
({ provider, modelId }: { provider: string; modelId: string }) =>
551+
provider === "opencode-go" && modelId === "deepseek-v4-pro"
552+
? {
553+
provider,
554+
id: modelId,
555+
name: "DeepSeek V4 Pro",
556+
api: "anthropic-messages",
557+
baseUrl: "https://opencode.ai/zen/go",
558+
input: ["text"],
559+
contextWindow: 1_000_000,
560+
maxTokens: 384_000,
561+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
562+
}
563+
: undefined,
564+
);
565+
const runtime = createRuntime();
566+
567+
await modelsListCommand({ all: true, provider: "opencode-go", json: true }, runtime as never);
568+
569+
expect(lastPrintedRows<{ key: string }>()).toEqual([
570+
expect.objectContaining({
571+
key: "opencode-go/deepseek-v4-pro",
572+
}),
573+
]);
574+
});
575+
531576
it("includes synthetic codex gpt-5.4 in --all output when catalog supports it", async () => {
532577
mocks.resolveConfiguredEntries.mockReturnValueOnce({ entries: [] });
533578
mocks.loadModelRegistry.mockResolvedValueOnce({

‎src/commands/models/list.row-sources.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function appendAllModelRowSources(
7777
seenKeys,
7878
});
7979

80-
if (params.modelRegistry && !params.context.filter.provider) {
80+
if (params.modelRegistry) {
8181
await appendCatalogSupplementRows({
8282
rows: params.rows,
8383
modelRegistry: params.modelRegistry,

0 commit comments

Comments
 (0)