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

推荐订阅源

人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
量子位
GbyAI
GbyAI
腾讯CDC
T
Tailwind CSS Blog
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
Jina AI
Jina AI
IT之家
IT之家
Y
Y Combinator 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
fix: guard metadata reuse on load paths · openclaw/opencl...
shakkernerd · 2026-05-07 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -41,6 +41,10 @@ function sanitizeProjectSettings(settings: PiSettingsSnapshot): PiSettingsSnapsh

4141

return sanitizePiSettingsSnapshot(settings);

4242

}

4343
44+

function canReuseUnscopedCurrentPluginMetadataSnapshot(config: OpenClawConfig): boolean {

45+

return normalizePluginsConfigWithResolver(config.plugins).loadPaths.length === 0;

46+

}

47+
4448

function loadBundleSettingsFile(params: {

4549

rootDir: string;

4650

relativePath: string;

@@ -90,11 +94,13 @@ export function loadEnabledBundlePiSettingsSnapshot(params: {

9094

env,

9195

workspaceDir,

9296

}) ??

93-

getCurrentPluginMetadataSnapshot({

94-

env,

95-

workspaceDir,

96-

allowWorkspaceScopedSnapshot: true,

97-

}) ??

97+

(canReuseUnscopedCurrentPluginMetadataSnapshot(config)

98+

? getCurrentPluginMetadataSnapshot({

99+

env,

100+

workspaceDir,

101+

allowWorkspaceScopedSnapshot: true,

102+

})

103+

: undefined) ??

98104

loadPluginMetadataSnapshot({

99105

workspaceDir,

100106

config,

Original file line numberDiff line numberDiff line change

@@ -325,6 +325,45 @@ describe("loadEnabledBundlePiSettingsSnapshot", () => {

325325

expect(pluginMetadataSnapshotMocks.loadPluginMetadataSnapshot).not.toHaveBeenCalled();

326326

});

327327
328+

it("does not reuse an unscoped current snapshot when plugin load paths change", async () => {

329+

const workspaceDir = await tempDirs.make("openclaw-workspace-");

330+

const pluginRoot = await createWorkspaceBundle({ workspaceDir });

331+

const resolvedPluginRoot = await fs.realpath(pluginRoot);

332+

await fs.writeFile(

333+

path.join(pluginRoot, "settings.json"),

334+

JSON.stringify({ hideThinkingBlock: true }),

335+

"utf-8",

336+

);

337+
338+

pluginMetadataSnapshotMocks.getCurrentPluginMetadataSnapshot.mockReturnValueOnce(undefined);

339+

pluginMetadataSnapshotMocks.loadPluginMetadataSnapshot.mockClear();

340+
341+

const snapshot = loadEnabledBundlePiSettingsSnapshot({

342+

cwd: workspaceDir,

343+

cfg: {

344+

plugins: {

345+

load: { paths: ["/tmp/changed-plugin-root"] },

346+

entries: {

347+

"claude-bundle": { enabled: true },

348+

},

349+

},

350+

},

351+

});

352+
353+

expect(snapshot.hideThinkingBlock).toBe(true);

354+

expect(pluginMetadataSnapshotMocks.getCurrentPluginMetadataSnapshot).toHaveBeenCalledOnce();

355+

expect(pluginMetadataSnapshotMocks.getCurrentPluginMetadataSnapshot).toHaveBeenCalledWith({

356+

config: expect.objectContaining({

357+

plugins: expect.objectContaining({

358+

load: { paths: ["/tmp/changed-plugin-root"] },

359+

}),

360+

}),

361+

env: process.env,

362+

workspaceDir,

363+

});

364+

expect(pluginMetadataSnapshotMocks.loadPluginMetadataSnapshot).toHaveBeenCalledOnce();

365+

});

366+
328367

it("loads sanitized settings and MCP defaults from enabled bundle plugins", async () => {

329368

const workspaceDir = await tempDirs.make("openclaw-workspace-");

330369

const pluginRoot = await createWorkspaceBundle({ workspaceDir });

Original file line numberDiff line numberDiff line change

@@ -168,6 +168,40 @@ describe("applyPluginAutoEnable core", () => {

168168

);

169169

});

170170
171+

it("does not reuse an unscoped current manifest registry when plugin load paths change", () => {

172+

const manifestRegistry = makeRegistry([{ id: "load-path-chat", channels: ["load-path-chat"] }]);

173+

const snapshotConfig: OpenClawConfig = { plugins: { allow: ["existing"] } };

174+

setCurrentPluginMetadataSnapshot(

175+

createPluginMetadataSnapshot({

176+

config: snapshotConfig,

177+

manifestRegistry,

178+

workspaceDir: "/tmp/workspace",

179+

}),

180+

{

181+

config: snapshotConfig,

182+

workspaceDir: "/tmp/workspace",

183+

},

184+

);

185+
186+

const result = applyPluginAutoEnable({

187+

config: {

188+

plugins: {

189+

allow: ["existing"],

190+

load: { paths: ["/tmp/changed-plugin-root"] },

191+

entries: {

192+

"load-path-chat": { config: { token: "x" } },

193+

},

194+

},

195+

},

196+

env,

197+

});

198+
199+

expect(result.config.plugins?.allow).toEqual(["existing"]);

200+

expect(result.changes).not.toContain(

201+

"load-path-chat plugin config present, added to plugin allowlist.",

202+

);

203+

});

204+
171205

it("formats typed provider-auth candidates into stable reasons", () => {

172206

expect(

173207

resolvePluginAutoEnableCandidateReason({

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ import {

99

listBundledChannelIdsWithConfiguredState,

1010

} from "../channels/plugins/configured-state.js";

1111

import { getChatChannelMeta, normalizeChatChannelId } from "../channels/registry.js";

12+

import { normalizePluginsConfig } from "../plugins/config-state.js";

1213

import { getCurrentPluginMetadataSnapshot } from "../plugins/current-plugin-metadata-snapshot.js";

1314

import { resolveInstalledPluginIndexPolicyHash } from "../plugins/installed-plugin-index-policy.js";

1415

import {

@@ -54,6 +55,10 @@ function resolveAutoEnableProviderPluginIds(

5455

return Object.fromEntries(entries);

5556

}

5657
58+

function canReuseUnscopedCurrentPluginMetadataSnapshot(config: OpenClawConfig): boolean {

59+

return normalizePluginsConfig(config.plugins).loadPaths.length === 0;

60+

}

61+
5762

function extractProviderFromModelRef(value: string): string | null {

5863

const trimmed = value.trim();

5964

const slash = trimmed.indexOf("/");

@@ -955,6 +960,9 @@ export function resolvePluginAutoEnableManifestRegistry(params: {

955960

const policyCompatibleCurrentSnapshot =

956961

currentSnapshot ??

957962

(() => {

963+

if (!canReuseUnscopedCurrentPluginMetadataSnapshot(params.config)) {

964+

return undefined;

965+

}

958966

const snapshot = getCurrentPluginMetadataSnapshot({

959967

env: params.env,

960968

allowWorkspaceScopedSnapshot: true,