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

推荐订阅源

博客园_首页
IT之家
IT之家
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
H
Help Net Security
V
V2EX
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 【当耐特】
月光博客
月光博客
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件

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
perf(test): avoid bundled setup in auto-enable tests · op...
steipete · 2026-04-23 · via Recent Commits to openclaw:main

@@ -1,5 +1,8 @@

11

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

2-

import { applyPluginAutoEnable } from "./plugin-auto-enable.js";

2+

import {

3+

applyPluginAutoEnable,

4+

materializePluginAutoEnableCandidates,

5+

} from "./plugin-auto-enable.js";

36

import {

47

makeIsolatedEnv,

58

makeRegistry,

@@ -26,12 +29,19 @@ describe("applyPluginAutoEnable providers", () => {

2629

},

2730

},

2831

env,

32+

manifestRegistry: makeRegistry([

33+

{

34+

id: "google",

35+

channels: [],

36+

autoEnableWhenConfiguredProviders: ["google-gemini-cli"],

37+

},

38+

]),

2939

});

30403141

expect(result.config.plugins?.entries?.google?.enabled).toBe(true);

3242

});

334334-

it("auto-enables bundled provider plugins when plugin-owned web search config exists", () => {

44+

it("auto-enables provider plugins when plugin-owned web search config exists", () => {

3545

const result = applyPluginAutoEnable({

3646

config: {

3747

plugins: {

@@ -47,14 +57,24 @@ describe("applyPluginAutoEnable providers", () => {

4757

},

4858

},

4959

env,

60+

manifestRegistry: makeRegistry([

61+

{

62+

id: "xai",

63+

channels: [],

64+

providers: ["xai"],

65+

contracts: {

66+

webSearchProviders: ["grok"],

67+

},

68+

},

69+

]),

5070

});

51715272

expect(result.config.plugins?.entries?.xai?.enabled).toBe(true);

5373

expect(result.changes).toContain("xai web search configured, enabled automatically.");

5474

});

557556-

it("auto-enables xai when the plugin-owned x_search tool is configured", () => {

57-

const result = applyPluginAutoEnable({

76+

it("materializes xai setup auto-enable when the plugin-owned x_search tool is configured", () => {

77+

const result = materializePluginAutoEnableCandidates({

5878

config: {

5979

plugins: {

6080

entries: {

@@ -68,15 +88,23 @@ describe("applyPluginAutoEnable providers", () => {

6888

},

6989

},

7090

},

91+

candidates: [

92+

{

93+

pluginId: "xai",

94+

kind: "setup-auto-enable",

95+

reason: "xai tool configured",

96+

},

97+

],

7198

env,

99+

manifestRegistry: makeRegistry([{ id: "xai", channels: [] }]),

72100

});

7310174102

expect(result.config.plugins?.entries?.xai?.enabled).toBe(true);

75103

expect(result.changes).toContain("xai tool configured, enabled automatically.");

76104

});

7710578-

it("auto-enables xai when the plugin-owned codeExecution config is configured", () => {

79-

const result = applyPluginAutoEnable({

106+

it("materializes xai setup auto-enable when the plugin-owned codeExecution config is configured", () => {

107+

const result = materializePluginAutoEnableCandidates({

80108

config: {

81109

plugins: {

82110

entries: {

@@ -91,7 +119,15 @@ describe("applyPluginAutoEnable providers", () => {

91119

},

92120

},

93121

},

122+

candidates: [

123+

{

124+

pluginId: "xai",

125+

kind: "setup-auto-enable",

126+

reason: "xai tool configured",

127+

},

128+

],

94129

env,

130+

manifestRegistry: makeRegistry([{ id: "xai", channels: [] }]),

95131

});

9613297133

expect(result.config.plugins?.entries?.xai?.enabled).toBe(true);

@@ -111,6 +147,13 @@ describe("applyPluginAutoEnable providers", () => {

111147

},

112148

},

113149

env,

150+

manifestRegistry: makeRegistry([

151+

{

152+

id: "minimax",

153+

channels: [],

154+

autoEnableWhenConfiguredProviders: ["minimax-portal"],

155+

},

156+

]),

114157

});

115158116159

expect(result.config.plugins?.entries?.minimax?.enabled).toBe(true);

@@ -130,6 +173,13 @@ describe("applyPluginAutoEnable providers", () => {

130173

},

131174

},

132175

env,

176+

manifestRegistry: makeRegistry([

177+

{

178+

id: "minimax",

179+

channels: [],

180+

autoEnableWhenConfiguredProviders: ["minimax"],

181+

},

182+

]),

133183

});

134184135185

expect(result.config.plugins?.entries?.minimax?.enabled).toBe(true);

@@ -148,6 +198,7 @@ describe("applyPluginAutoEnable providers", () => {

148198

},

149199

},

150200

env,

201+

manifestRegistry: makeRegistry([]),

151202

});

152203153204

expect(result.config.plugins?.entries?.openai).toBeUndefined();

@@ -249,31 +300,40 @@ describe("applyPluginAutoEnable providers", () => {

249300

expect(result.changes).toContain("acme tool configured, enabled automatically.");

250301

});

251302252-

it("auto-enables acpx plugin when ACP is configured", () => {

253-

const result = applyPluginAutoEnable({

303+

it("materializes acpx setup auto-enable when ACP is configured", () => {

304+

const result = materializePluginAutoEnableCandidates({

254305

config: {

255306

acp: {

256307

enabled: true,

257308

},

258309

},

310+

candidates: [

311+

{

312+

pluginId: "acpx",

313+

kind: "setup-auto-enable",

314+

reason: "ACP runtime configured",

315+

},

316+

],

259317

env,

260318

});

261319262320

expect(result.config.plugins?.entries?.acpx?.enabled).toBe(true);

263321

expect(result.changes.join("\n")).toContain("ACP runtime configured, enabled automatically.");

264322

});

265323266-

it("does not auto-enable acpx when a different ACP backend is configured", () => {

267-

const result = applyPluginAutoEnable({

324+

it("does not materialize acpx when no setup auto-enable candidate is present", () => {

325+

const result = materializePluginAutoEnableCandidates({

268326

config: {

269327

acp: {

270328

enabled: true,

271329

backend: "custom-runtime",

272330

},

273331

},

332+

candidates: [],

274333

env,

275334

});

276335277336

expect(result.config.plugins?.entries?.acpx?.enabled).toBeUndefined();

337+

expect(result.changes).toEqual([]);

278338

});

279339

});