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

推荐订阅源

Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
爱范儿
爱范儿
罗磊的独立博客
博客园_首页
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
V
Visual Studio Blog
T
Tailwind CSS 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: clear gateway startup secrets broad matchers · open...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -61,6 +61,12 @@ function preparedSnapshot(config: OpenClawConfig): PreparedSecretsRuntimeSnapsho

6161

};

6262

}

636364+

function callArg<T>(mock: { mock: { calls: unknown[][] } }, index = 0): T {

65+

const call = mock.mock.calls[index];

66+

expect(call).toBeDefined();

67+

return call?.[0] as T;

68+

}

69+6470

describe("gateway startup config secret preflight", () => {

6571

const previousSkipChannels = process.env.OPENCLAW_SKIP_CHANNELS;

6672

const previousSkipProviders = process.env.OPENCLAW_SKIP_PROVIDERS;

@@ -124,10 +130,12 @@ describe("gateway startup config secret preflight", () => {

124130

activate: false,

125131

});

126132127-

expect(prepareRuntimeSecretsSnapshot).toHaveBeenCalledWith({

128-

config: expect.any(Object),

129-

loadAuthStore: loadAuthProfileStoreWithoutExternalProfiles,

130-

});

133+

const preflightInput = callArg<{

134+

config?: unknown;

135+

loadAuthStore?: unknown;

136+

}>(prepareRuntimeSecretsSnapshot);

137+

expect(typeof preflightInput.config).toBe("object");

138+

expect(preflightInput.loadAuthStore).toBe(loadAuthProfileStoreWithoutExternalProfiles);

131139

});

132140133141

it("does not emit degraded or recovered events for warning-only secret reloads", async () => {

@@ -153,37 +161,33 @@ describe("gateway startup config secret preflight", () => {

153161

activateRuntimeSecretsSnapshot: vi.fn(),

154162

});

155163156-

await expect(

157-

activateRuntimeSecrets(

158-

{

159-

plugins: {

160-

entries: {

161-

google: {

162-

enabled: true,

163-

config: {

164-

webSearch: {

165-

apiKey: { source: "env", provider: "default", id: "MISSING_GEMINI_KEY" },

166-

},

167-

},

164+

const config = {

165+

plugins: {

166+

entries: {

167+

google: {

168+

enabled: true,

169+

config: {

170+

webSearch: {

171+

apiKey: { source: "env", provider: "default", id: "MISSING_GEMINI_KEY" },

168172

},

169173

},

170174

},

171175

},

172-

{

173-

reason: "reload",

174-

activate: true,

175-

},

176-

),

177-

).resolves.toMatchObject({

178-

warnings: [warning],

176+

},

177+

};

178+

const result = await activateRuntimeSecrets(config, {

179+

reason: "reload",

180+

activate: true,

179181

});

182+

expect(result.sourceConfig).toBe(config);

183+

expect(result.config).toBe(config);

184+

expect(result.warnings).toEqual([warning]);

180185

expect(logSecrets.warn).toHaveBeenCalledWith(

181186

"[WEB_SEARCH_KEY_UNRESOLVED_FALLBACK_USED] web search provider fell back to environment credentials",

182187

);

183188

expect(emitStateEvent).not.toHaveBeenCalled();

184-

expect(prepareRuntimeSecretsSnapshot).toHaveBeenCalledWith({

185-

config: expect.any(Object),

186-

});

189+

const preflightInput = callArg<{ config?: unknown }>(prepareRuntimeSecretsSnapshot);

190+

expect(typeof preflightInput.config).toBe("object");

187191

});

188192189193

it.each(KNOWN_WEAK_GATEWAY_TOKEN_PLACEHOLDERS)(

@@ -259,22 +263,17 @@ describe("gateway startup config secret preflight", () => {

259263

}),

260264

);

261265262-

await expect(

263-

activateRuntimeSecrets(config, {

264-

reason: "startup",

265-

activate: false,

266-

}),

267-

).resolves.toMatchObject({

268-

config: expect.objectContaining({

269-

gateway: expect.any(Object),

270-

}),

271-

});

272-

expect(prepareRuntimeSecretsSnapshot).toHaveBeenCalledWith({

273-

config: expect.not.objectContaining({

274-

channels: expect.anything(),

275-

}),

276-

loadAuthStore: loadAuthProfileStoreWithoutExternalProfiles,

266+

const result = await activateRuntimeSecrets(config, {

267+

reason: "startup",

268+

activate: false,

277269

});

270+

expect(typeof result.config.gateway).toBe("object");

271+

const preflightInput = callArg<{

272+

config?: OpenClawConfig;

273+

loadAuthStore?: unknown;

274+

}>(prepareRuntimeSecretsSnapshot);

275+

expect(preflightInput.config?.channels).toBeUndefined();

276+

expect(preflightInput.loadAuthStore).toBe(loadAuthProfileStoreWithoutExternalProfiles);

278277

});

279278280279

it("honors startup auth overrides before secret preflight gating", async () => {

@@ -310,21 +309,15 @@ describe("gateway startup config secret preflight", () => {

310309

}),

311310

});

312311313-

expect(result.auth).toMatchObject({

314-

mode: "password",

315-

password: "override-password",

316-

});

317-

expect(prepareRuntimeSecretsSnapshot).toHaveBeenNthCalledWith(1, {

318-

config: expect.objectContaining({

319-

gateway: expect.objectContaining({

320-

auth: expect.objectContaining({

321-

mode: "password",

322-

password: "override-password",

323-

}),

324-

}),

325-

}),

326-

loadAuthStore: loadAuthProfileStoreWithoutExternalProfiles,

327-

});

312+

expect(result.auth.mode).toBe("password");

313+

expect(result.auth.password).toBe("override-password");

314+

const preflightInput = callArg<{

315+

config?: OpenClawConfig;

316+

loadAuthStore?: unknown;

317+

}>(prepareRuntimeSecretsSnapshot);

318+

expect(preflightInput.config?.gateway?.auth?.mode).toBe("password");

319+

expect(preflightInput.config?.gateway?.auth?.password).toBe("override-password");

320+

expect(preflightInput.loadAuthStore).toBe(loadAuthProfileStoreWithoutExternalProfiles);

328321

expect(activateRuntimeSecretsSnapshot).toHaveBeenCalledTimes(1);

329322

});

330323

@@ -344,21 +337,15 @@ describe("gateway startup config secret preflight", () => {

344337

}),

345338

});

346339347-

expect(result.auth).toMatchObject({

348-

mode: "token",

349-

token: "startup-test-token",

350-

});

340+

expect(result.auth.mode).toBe("token");

341+

expect(result.auth.token).toBe("startup-test-token");

351342

expect(prepareRuntimeSecretsSnapshot).toHaveBeenCalledTimes(1);

352-

expect(prepareRuntimeSecretsSnapshot).toHaveBeenCalledWith({

353-

config: expect.objectContaining({

354-

gateway: expect.objectContaining({

355-

auth: expect.objectContaining({

356-

token: "startup-test-token",

357-

}),

358-

}),

359-

}),

360-

loadAuthStore: loadAuthProfileStoreWithoutExternalProfiles,

361-

});

343+

const preflightInput = callArg<{

344+

config?: OpenClawConfig;

345+

loadAuthStore?: unknown;

346+

}>(prepareRuntimeSecretsSnapshot);

347+

expect(preflightInput.config?.gateway?.auth?.token).toBe("startup-test-token");

348+

expect(preflightInput.loadAuthStore).toBe(loadAuthProfileStoreWithoutExternalProfiles);

362349

});

363350364351

it("uses gateway auth strings resolved during startup preflight for bootstrap auth", async () => {

@@ -401,10 +388,8 @@ describe("gateway startup config secret preflight", () => {

401388

}),

402389

});

403390404-

expect(result.auth).toMatchObject({

405-

mode: "token",

406-

token: "resolved-gateway-token",

407-

});

391+

expect(result.auth.mode).toBe("token");

392+

expect(result.auth.token).toBe("resolved-gateway-token");

408393

expect(prepareRuntimeSecretsSnapshot).toHaveBeenCalledTimes(2);

409394

});

410395

});