惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
D
Docker
GbyAI
GbyAI
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
小众软件
小众软件
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
B
Blog
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: tighten opencode go catalog assertions · openclaw/o...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -7,6 +7,32 @@ import { expectPassthroughReplayPolicy } from "openclaw/plugin-sdk/provider-test

77

import { describe, expect, it } from "vitest";

88

import plugin from "./index.js";

9910+

function requireRecord(value: unknown, label: string): Record<string, unknown> {

11+

if (value === null || typeof value !== "object" || Array.isArray(value)) {

12+

throw new Error(`expected ${label} to be a record`);

13+

}

14+

return value as Record<string, unknown>;

15+

}

16+17+

function requireMapEntry<T>(map: Map<string, T>, id: string): T {

18+

const entry = map.get(id);

19+

if (!entry) {

20+

throw new Error(`expected model ${id}`);

21+

}

22+

return entry;

23+

}

24+25+

function requireCatalogEntry(entries: readonly unknown[] | null | undefined, id: string) {

26+

if (!entries) {

27+

throw new Error("expected supplemental catalog entries");

28+

}

29+

const entry = entries.find((candidate) => requireRecord(candidate, "catalog entry").id === id);

30+

if (!entry) {

31+

throw new Error(`expected supplemental catalog entry ${id}`);

32+

}

33+

return requireRecord(entry, `supplemental catalog entry ${id}`);

34+

}

35+1036

describe("opencode-go provider plugin", () => {

1137

it("registers image media understanding through the OpenCode Go plugin", async () => {

1238

const { mediaProviders } = await registerProviderPlugin({

@@ -52,6 +78,8 @@ describe("opencode-go provider plugin", () => {

5278

"glm-5.1",

5379

"kimi-k2.5",

5480

"kimi-k2.6",

81+

"mimo-v2-omni",

82+

"mimo-v2-pro",

5583

"mimo-v2.5",

5684

"mimo-v2.5-pro",

5785

"minimax-m2.5",

@@ -66,68 +94,71 @@ describe("opencode-go provider plugin", () => {

6694

name: model.name,

6795

})),

6896

} as never);

69-

expect(supplemental).toEqual(

70-

expect.arrayContaining([

71-

expect.objectContaining({

72-

provider: "opencode-go",

73-

id: "deepseek-v4-pro",

74-

name: "DeepSeek V4 Pro",

75-

}),

76-

expect.objectContaining({

77-

provider: "opencode-go",

78-

id: "deepseek-v4-flash",

79-

name: "DeepSeek V4 Flash",

80-

}),

81-

]),

82-

);

97+

const deepSeekPro = requireCatalogEntry(supplemental, "deepseek-v4-pro");

98+

expect(deepSeekPro.provider).toBe("opencode-go");

99+

expect(deepSeekPro.name).toBe("DeepSeek V4 Pro");

100+

const deepSeekFlash = requireCatalogEntry(supplemental, "deepseek-v4-flash");

101+

expect(deepSeekFlash.provider).toBe("opencode-go");

102+

expect(deepSeekFlash.name).toBe("DeepSeek V4 Flash");

8310384-

expect(models.get("kimi-k2.6")).toMatchObject({

85-

api: "openai-completions",

86-

baseUrl: "https://opencode.ai/zen/go/v1",

87-

input: ["text", "image"],

88-

reasoning: true,

89-

contextWindow: 262_144,

90-

maxTokens: 65_536,

91-

});

92-

expect(models.get("minimax-m2.7")).toMatchObject({

93-

api: "openai-completions",

94-

baseUrl: "https://opencode.ai/zen/go/v1",

95-

reasoning: true,

96-

contextWindow: 204_800,

97-

maxTokens: 131_072,

98-

});

99-

expect(models.get("mimo-v2.5-pro")).toMatchObject({

100-

api: "openai-completions",

101-

baseUrl: "https://opencode.ai/zen/go/v1",

102-

input: ["text"],

103-

reasoning: true,

104-

contextWindow: 1_048_576,

105-

maxTokens: 128_000,

106-

});

107-

expect(models.get("mimo-v2.5")).toMatchObject({

108-

input: ["text", "image"],

109-

reasoning: true,

110-

contextWindow: 1_000_000,

111-

maxTokens: 128_000,

112-

});

113-

expect(

104+

const kimi = requireMapEntry(models, "kimi-k2.6");

105+

expect(kimi.api).toBe("openai-completions");

106+

expect(kimi.baseUrl).toBe("https://opencode.ai/zen/go/v1");

107+

expect(kimi.input).toEqual(["text", "image"]);

108+

expect(kimi.reasoning).toBe(true);

109+

expect(kimi.contextWindow).toBe(262_144);

110+

expect(kimi.maxTokens).toBe(65_536);

111+112+

const minimax = requireMapEntry(models, "minimax-m2.7");

113+

expect(minimax.api).toBe("openai-completions");

114+

expect(minimax.baseUrl).toBe("https://opencode.ai/zen/go/v1");

115+

expect(minimax.reasoning).toBe(true);

116+

expect(minimax.contextWindow).toBe(204_800);

117+

expect(minimax.maxTokens).toBe(131_072);

118+119+

const mimoPro = requireMapEntry(models, "mimo-v2.5-pro");

120+

expect(mimoPro.api).toBe("openai-completions");

121+

expect(mimoPro.baseUrl).toBe("https://opencode.ai/zen/go/v1");

122+

expect(mimoPro.input).toEqual(["text"]);

123+

expect(mimoPro.reasoning).toBe(true);

124+

expect(mimoPro.contextWindow).toBe(1_048_576);

125+

expect(mimoPro.maxTokens).toBe(128_000);

126+127+

const mimo = requireMapEntry(models, "mimo-v2.5");

128+

expect(mimo.input).toEqual(["text", "image"]);

129+

expect(mimo.reasoning).toBe(true);

130+

expect(mimo.contextWindow).toBe(1_000_000);

131+

expect(mimo.maxTokens).toBe(128_000);

132+133+

const mimoOmni = requireMapEntry(models, "mimo-v2-omni");

134+

expect(mimoOmni.input).toEqual(["text", "image"]);

135+

expect(mimoOmni.reasoning).toBe(true);

136+

expect(mimoOmni.contextWindow).toBe(262_144);

137+

expect(mimoOmni.maxTokens).toBe(128_000);

138+139+

const mimoV2Pro = requireMapEntry(models, "mimo-v2-pro");

140+

expect(mimoV2Pro.input).toEqual(["text"]);

141+

expect(mimoV2Pro.reasoning).toBe(true);

142+

expect(mimoV2Pro.contextWindow).toBe(1_048_576);

143+

expect(mimoV2Pro.maxTokens).toBe(128_000);

144+145+

const dynamicModel = requireRecord(

114146

provider.resolveDynamicModel?.({

115147

modelId: "deepseek-v4-pro",

116148

} as never),

117-

).toMatchObject({

118-

id: "deepseek-v4-pro",

119-

api: "openai-completions",

120-

provider: "opencode-go",

121-

baseUrl: "https://opencode.ai/zen/go/v1",

122-

reasoning: true,

123-

contextWindow: 1_000_000,

124-

maxTokens: 384_000,

125-

compat: {

126-

supportsUsageInStreaming: true,

127-

supportsReasoningEffort: true,

128-

maxTokensField: "max_tokens",

129-

},

130-

});

149+

"dynamic model",

150+

);

151+

expect(dynamicModel.id).toBe("deepseek-v4-pro");

152+

expect(dynamicModel.api).toBe("openai-completions");

153+

expect(dynamicModel.provider).toBe("opencode-go");

154+

expect(dynamicModel.baseUrl).toBe("https://opencode.ai/zen/go/v1");

155+

expect(dynamicModel.reasoning).toBe(true);

156+

expect(dynamicModel.contextWindow).toBe(1_000_000);

157+

expect(dynamicModel.maxTokens).toBe(384_000);

158+

const compat = requireRecord(dynamicModel.compat, "dynamic model compat");

159+

expect(compat.supportsUsageInStreaming).toBe(true);

160+

expect(compat.supportsReasoningEffort).toBe(true);

161+

expect(compat.maxTokensField).toBe("max_tokens");

131162

});

132163133164

it("disables invalid DeepSeek V4 reasoning_effort off payloads on OpenCode Go", async () => {

@@ -169,7 +200,7 @@ describe("opencode-go provider plugin", () => {

169200

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

170201

const provider = await registerSingleProviderPlugin(plugin);

171202172-

expect(

203+

const normalizedConfig = requireRecord(

173204

provider.normalizeConfig?.({

174205

provider: "opencode-go",

175206

providerConfig: {

@@ -178,11 +209,11 @@ describe("opencode-go provider plugin", () => {

178209

models: [],

179210

},

180211

} as never),

181-

).toMatchObject({

182-

baseUrl: "https://opencode.ai/zen/go/v1",

183-

});

212+

"normalized config",

213+

);

214+

expect(normalizedConfig.baseUrl).toBe("https://opencode.ai/zen/go/v1");

184215185-

expect(

216+

const normalizedModel = requireRecord(

186217

provider.normalizeResolvedModel?.({

187218

provider: "opencode-go",

188219

model: {

@@ -198,9 +229,9 @@ describe("opencode-go provider plugin", () => {

198229

maxTokens: 65_536,

199230

},

200231

} as never),

201-

).toMatchObject({

202-

baseUrl: "https://opencode.ai/zen/go/v1",

203-

});

232+

"normalized model",

233+

);

234+

expect(normalizedModel.baseUrl).toBe("https://opencode.ai/zen/go/v1");

204235205236

expect(

206237

provider.normalizeTransport?.({