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

推荐订阅源

L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
量子位
V
V2EX
S
SegmentFault 最新的问题
月光博客
月光博客
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
博客园_首页
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
Y
Y Combinator Blog
The Cloudflare Blog
C
Check Point Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
B
Blog
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed

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
fix: reuse plugin metadata for config schemas · openclaw/...
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -12,6 +12,7 @@ import type { ConfigFileSnapshot, OpenClawConfig } from "./types.js";

1212

const mockLoadConfig = vi.hoisted(() => vi.fn<() => OpenClawConfig>());

1313

const mockReadConfigFileSnapshot = vi.hoisted(() => vi.fn<() => Promise<ConfigFileSnapshot>>());

1414

const mockLoadPluginManifestRegistry = vi.hoisted(() => vi.fn());

15+

const mockGetCurrentPluginMetadataSnapshot = vi.hoisted(() => vi.fn());

15161617

let readBestEffortRuntimeConfigSchema: typeof import("./runtime-schema.js").readBestEffortRuntimeConfigSchema;

1718

let loadGatewayRuntimeConfigSchema: typeof import("./runtime-schema.js").loadGatewayRuntimeConfigSchema;

@@ -33,6 +34,11 @@ vi.mock("../plugins/plugin-registry.js", () => ({

3334

mockLoadPluginManifestRegistry(...args),

3435

}));

353637+

vi.mock("../plugins/current-plugin-metadata-snapshot.js", () => ({

38+

getCurrentPluginMetadataSnapshot: (...args: unknown[]) =>

39+

mockGetCurrentPluginMetadataSnapshot(...args),

40+

}));

41+3642

function makeSnapshot(params: { valid: boolean; config?: OpenClawConfig }): ConfigFileSnapshot {

3743

return {

3844

path: "/tmp/openclaw.json",

@@ -182,7 +188,7 @@ describe("readBestEffortRuntimeConfigSchema", () => {

182188

expect(mockLoadPluginManifestRegistry).toHaveBeenCalledWith(

183189

expect.objectContaining({

184190

config: { plugins: { entries: { demo: { enabled: true } } } },

185-

cache: false,

191+

cache: true,

186192

}),

187193

);

188194

expect(channelProps?.telegram).toBeTruthy();

@@ -198,7 +204,7 @@ describe("readBestEffortRuntimeConfigSchema", () => {

198204

expect(mockLoadPluginManifestRegistry).toHaveBeenCalledWith(

199205

expect.objectContaining({

200206

config: { plugins: { enabled: true } },

201-

cache: false,

207+

cache: true,

202208

}),

203209

);

204210

expect(channelProps?.telegram).toBeTruthy();

@@ -223,10 +229,62 @@ describe("loadGatewayRuntimeConfigSchema", () => {

223229

expect(mockLoadPluginManifestRegistry).toHaveBeenCalledWith(

224230

expect.objectContaining({

225231

config: { plugins: { entries: { demo: { enabled: true } } } },

226-

cache: false,

232+

cache: true,

233+

}),

234+

);

235+

expect(mockLoadPluginManifestRegistry.mock.calls[0]?.[0]).not.toHaveProperty(

236+

"bundledChannelConfigCollector",

237+

);

238+

expect(channelProps?.telegram).toBeTruthy();

239+

expect(channelProps?.matrix).toBeTruthy();

240+

});

241+242+

it("reuses the current gateway plugin metadata snapshot for config schema requests", () => {

243+

mockGetCurrentPluginMetadataSnapshot.mockReturnValueOnce({

244+

manifestRegistry: {

245+

diagnostics: [],

246+

plugins: [

247+

{

248+

id: "telegram",

249+

name: "Telegram",

250+

description: "Telegram plugin",

251+

origin: "bundled",

252+

channels: ["telegram"],

253+

},

254+

{

255+

id: "matrix",

256+

name: "Matrix",

257+

description: "Matrix plugin",

258+

origin: "workspace",

259+

channels: ["matrix"],

260+

channelConfigs: {

261+

matrix: {

262+

schema: {

263+

type: "object",

264+

properties: {

265+

homeserver: { type: "string" },

266+

},

267+

},

268+

},

269+

},

270+

},

271+

],

272+

},

273+

});

274+275+

const result = loadGatewayRuntimeConfigSchema();

276+

const schema = result.schema as { properties?: Record<string, unknown> };

277+

const channelsNode = schema.properties?.channels as Record<string, unknown> | undefined;

278+

const channelProps = channelsNode?.properties as Record<string, unknown> | undefined;

279+280+

expect(mockGetCurrentPluginMetadataSnapshot).toHaveBeenCalledWith(

281+

expect.objectContaining({

282+

config: { plugins: { entries: { demo: { enabled: true } } } },

227283

}),

228284

);

285+

expect(mockLoadPluginManifestRegistry).not.toHaveBeenCalled();

229286

expect(channelProps?.telegram).toBeTruthy();

287+

expect(JSON.stringify(channelProps?.telegram)).toContain("botToken");

230288

expect(channelProps?.matrix).toBeTruthy();

231289

});

232290

@@ -246,7 +304,8 @@ describe("loadGatewayRuntimeConfigSchema", () => {

246304247305

expect(mockLoadPluginManifestRegistry).toHaveBeenCalledTimes(3);

248306

for (const call of mockLoadPluginManifestRegistry.mock.calls) {

249-

expect(call[0]).toMatchObject({ cache: false });

307+

expect(call[0]).toMatchObject({ cache: true });

308+

expect(call[0]).not.toHaveProperty("bundledChannelConfigCollector");

250309

}

251310

expect(getActivePluginRegistry()).toBe(activeRegistry);

252311

expect(getActivePluginRegistryKey()).toBe("startup-registry");