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

推荐订阅源

T
The Blog of Author Tim Ferriss
IT之家
IT之家
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
C
Check Point Blog
T
Tailwind CSS Blog
博客园 - Franky
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
博客园 - 叶小钗
J
Java Code Geeks
腾讯CDC
罗磊的独立博客
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
B
Blog
V
Visual Studio Blog
F
Fortinet All Blogs

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 search setup assertions · openclaw/openclaw...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -131,6 +131,29 @@ vi.mock("../commands/onboarding-plugin-install.js", () => ({

131131

ensureOnboardingPluginInstalled,

132132

}));

133133134+

function latestPluginInstallRequest(): {

135+

autoConfirmSingleSource?: boolean;

136+

entry?: {

137+

install?: { npmSpec?: string };

138+

label?: string;

139+

pluginId?: string;

140+

trustedSourceLinkedOfficialInstall?: boolean;

141+

};

142+

} {

143+

const [request] = ensureOnboardingPluginInstalled.mock.calls.at(-1) as unknown as [

144+

{

145+

autoConfirmSingleSource?: boolean;

146+

entry?: {

147+

install?: { npmSpec?: string };

148+

label?: string;

149+

pluginId?: string;

150+

trustedSourceLinkedOfficialInstall?: boolean;

151+

};

152+

},

153+

];

154+

return request;

155+

}

156+134157

describe("runSearchSetupFlow", () => {

135158

beforeEach(() => {

136159

ensureOnboardingPluginInstalled.mockClear();

@@ -154,17 +177,14 @@ describe("runSearchSetupFlow", () => {

154177

prompter,

155178

);

156179157-

expect(next.plugins?.entries?.xai?.config?.webSearch).toMatchObject({

158-

apiKey: "xai-test-key",

159-

});

160-

expect(next.tools?.web?.search).toMatchObject({

161-

provider: "grok",

162-

enabled: true,

163-

});

164-

expect(next.plugins?.entries?.xai?.config?.xSearch).toMatchObject({

165-

enabled: true,

166-

model: "grok-4-1-fast",

167-

});

180+

const xaiConfig = next.plugins?.entries?.xai?.config as

181+

| { webSearch?: { apiKey?: string }; xSearch?: { enabled?: boolean; model?: string } }

182+

| undefined;

183+

expect(xaiConfig?.webSearch?.apiKey).toBe("xai-test-key");

184+

expect(next.tools?.web?.search?.provider).toBe("grok");

185+

expect(next.tools?.web?.search?.enabled).toBe(true);

186+

expect(xaiConfig?.xSearch?.enabled).toBe(true);

187+

expect(xaiConfig?.xSearch?.model).toBe("grok-4-1-fast");

168188

});

169189170190

it("shows provider credential notes before plaintext credential prompts", async () => {

@@ -278,14 +298,13 @@ describe("runSearchSetupFlow", () => {

278298

prompter,

279299

);

280300281-

expect(next.tools?.web?.search).toMatchObject({

282-

provider: "grok",

283-

enabled: false,

284-

});

285-

expect(next.plugins?.entries?.xai?.config?.xSearch).toMatchObject({

286-

enabled: true,

287-

model: "grok-4-1-fast",

288-

});

301+

const xaiConfig = next.plugins?.entries?.xai?.config as

302+

| { xSearch?: { enabled?: boolean; model?: string } }

303+

| undefined;

304+

expect(next.tools?.web?.search?.provider).toBe("grok");

305+

expect(next.tools?.web?.search?.enabled).toBe(false);

306+

expect(xaiConfig?.xSearch?.enabled).toBe(true);

307+

expect(xaiConfig?.xSearch?.model).toBe("grok-4-1-fast");

289308

});

290309291310

it("installs an external catalog search provider before enabling it", async () => {

@@ -298,30 +317,21 @@ describe("runSearchSetupFlow", () => {

298317299318

const next = await runSearchSetupFlow({}, createNonExitingRuntime(), prompter);

300319301-

expect(ensureOnboardingPluginInstalled).toHaveBeenCalledWith(

302-

expect.objectContaining({

303-

entry: expect.objectContaining({

304-

pluginId: "brave",

305-

label: "Brave",

306-

trustedSourceLinkedOfficialInstall: true,

307-

install: expect.objectContaining({

308-

npmSpec: "@openclaw/brave-plugin",

309-

}),

310-

}),

311-

autoConfirmSingleSource: true,

312-

}),

313-

);

314-

expect(next.tools?.web?.search).toMatchObject({

315-

provider: "brave",

316-

enabled: true,

317-

});

318-

expect(next.plugins?.entries?.brave?.config?.webSearch).toMatchObject({

319-

apiKey: "brave-test-key",

320-

});

321-

expect(next.plugins?.installs?.brave).toMatchObject({

322-

source: "npm",

323-

spec: "@openclaw/brave-plugin",

324-

});

320+

expect(ensureOnboardingPluginInstalled).toHaveBeenCalledTimes(1);

321+

const installRequest = latestPluginInstallRequest();

322+

expect(installRequest.entry?.pluginId).toBe("brave");

323+

expect(installRequest.entry?.label).toBe("Brave");

324+

expect(installRequest.entry?.trustedSourceLinkedOfficialInstall).toBe(true);

325+

expect(installRequest.entry?.install?.npmSpec).toBe("@openclaw/brave-plugin");

326+

expect(installRequest.autoConfirmSingleSource).toBe(true);

327+

expect(next.tools?.web?.search?.provider).toBe("brave");

328+

expect(next.tools?.web?.search?.enabled).toBe(true);

329+

const braveConfig = next.plugins?.entries?.brave?.config as

330+

| { webSearch?: { apiKey?: string } }

331+

| undefined;

332+

expect(braveConfig?.webSearch?.apiKey).toBe("brave-test-key");

333+

expect(next.plugins?.installs?.brave?.source).toBe("npm");

334+

expect(next.plugins?.installs?.brave?.spec).toBe("@openclaw/brave-plugin");

325335

});

326336327337

it("installs an external catalog search provider when web search stays disabled", async () => {

@@ -347,30 +357,21 @@ describe("runSearchSetupFlow", () => {

347357

prompter,

348358

);

349359350-

expect(ensureOnboardingPluginInstalled).toHaveBeenCalledWith(

351-

expect.objectContaining({

352-

entry: expect.objectContaining({

353-

pluginId: "brave",

354-

label: "Brave",

355-

trustedSourceLinkedOfficialInstall: true,

356-

install: expect.objectContaining({

357-

npmSpec: "@openclaw/brave-plugin",

358-

}),

359-

}),

360-

autoConfirmSingleSource: true,

361-

}),

362-

);

363-

expect(next.tools?.web?.search).toMatchObject({

364-

provider: "brave",

365-

enabled: false,

366-

});

367-

expect(next.plugins?.entries?.brave?.config?.webSearch).toMatchObject({

368-

apiKey: "brave-disabled-key",

369-

});

360+

expect(ensureOnboardingPluginInstalled).toHaveBeenCalledTimes(1);

361+

const installRequest = latestPluginInstallRequest();

362+

expect(installRequest.entry?.pluginId).toBe("brave");

363+

expect(installRequest.entry?.label).toBe("Brave");

364+

expect(installRequest.entry?.trustedSourceLinkedOfficialInstall).toBe(true);

365+

expect(installRequest.entry?.install?.npmSpec).toBe("@openclaw/brave-plugin");

366+

expect(installRequest.autoConfirmSingleSource).toBe(true);

367+

expect(next.tools?.web?.search?.provider).toBe("brave");

368+

expect(next.tools?.web?.search?.enabled).toBe(false);

369+

const braveConfig = next.plugins?.entries?.brave?.config as

370+

| { webSearch?: { apiKey?: string } }

371+

| undefined;

372+

expect(braveConfig?.webSearch?.apiKey).toBe("brave-disabled-key");

370373

expect(next.plugins?.entries?.brave?.enabled).toBeUndefined();

371-

expect(next.plugins?.installs?.brave).toMatchObject({

372-

source: "npm",

373-

spec: "@openclaw/brave-plugin",

374-

});

374+

expect(next.plugins?.installs?.brave?.source).toBe("npm");

375+

expect(next.plugins?.installs?.brave?.spec).toBe("@openclaw/brave-plugin");

375376

});

376377

});