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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
B
Blog
腾讯CDC
P
Proofpoint News Feed
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
L
LangChain Blog
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
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
feat(plugins): migrate plugin registry on install · openc...
vincentkoc · 2026-04-25 · via Recent Commits to openclaw:main

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

1010

discoverBundledPluginRuntimeDeps,

1111

pruneBundledPluginSourceNodeModules,

1212

runBundledPluginPostinstall,

13+

runPluginRegistryPostinstallMigration,

1314

restoreLegacyUpdaterCompatSidecars,

1415

} from "../../scripts/postinstall-bundled-plugins.mjs";

1516

import { NPM_UPDATE_COMPAT_SIDECARS } from "../../src/infra/npm-update-compat-sidecars.ts";

@@ -247,6 +248,95 @@ describe("bundled plugin postinstall", () => {

247248

await expect(fs.stat(path.join(extensionsDir, "acpx", "node_modules"))).resolves.toBeTruthy();

248249

});

249250251+

it("migrates the plugin registry during postinstall from built dist contracts", async () => {

252+

const packageRoot = await createTempDirAsync("openclaw-postinstall-registry-");

253+

const log = { log: vi.fn(), warn: vi.fn() };

254+

const readBestEffortConfig = vi.fn(async () => ({

255+

plugins: {

256+

installs: {

257+

demo: {

258+

source: "npm",

259+

resolvedName: "@vendor/demo",

260+

resolvedVersion: "1.0.0",

261+

},

262+

},

263+

},

264+

}));

265+

const ensurePluginRegistryMigrated = vi.fn(async () => ({

266+

migrated: true,

267+

current: {

268+

plugins: [{ pluginId: "demo" }],

269+

},

270+

}));

271+

const importModule = vi.fn(async (specifier: string) => {

272+

if (specifier.endsWith("/dist/config/config.js")) {

273+

return { readBestEffortConfig };

274+

}

275+

if (specifier.endsWith("/dist/plugins/plugin-registry.js")) {

276+

return { ensurePluginRegistryMigrated };

277+

}

278+

throw new Error(`unexpected import: ${specifier}`);

279+

});

280+281+

const result = await runPluginRegistryPostinstallMigration({

282+

packageRoot,

283+

existsSync: vi.fn(

284+

(filePath: string) =>

285+

filePath.endsWith(path.join("dist", "config", "config.js")) ||

286+

filePath.endsWith(path.join("dist", "plugins", "plugin-registry.js")),

287+

),

288+

importModule,

289+

env: { OPENCLAW_HOME: "/tmp/home" },

290+

log,

291+

});

292+293+

expect(result).toMatchObject({ status: "migrated" });

294+

expect(readBestEffortConfig).toHaveBeenCalled();

295+

expect(ensurePluginRegistryMigrated).toHaveBeenCalledWith({

296+

config: {

297+

plugins: {

298+

installs: {

299+

demo: {

300+

source: "npm",

301+

resolvedName: "@vendor/demo",

302+

resolvedVersion: "1.0.0",

303+

},

304+

},

305+

},

306+

},

307+

env: { OPENCLAW_HOME: "/tmp/home" },

308+

packageRoot,

309+

});

310+

expect(log.log).toHaveBeenCalledWith(

311+

"[postinstall] migrated plugin registry: 1 plugin(s) indexed",

312+

);

313+

});

314+315+

it("keeps plugin registry postinstall migration non-fatal when dist entries are unavailable", async () => {

316+

const warn = vi.fn();

317+318+

await expect(

319+

runPluginRegistryPostinstallMigration({

320+

packageRoot: "/pkg",

321+

existsSync: vi.fn(() => false),

322+

log: { log: vi.fn(), warn },

323+

}),

324+

).resolves.toEqual({

325+

status: "skipped",

326+

reason: "missing-dist-entry",

327+

});

328+

expect(warn).not.toHaveBeenCalled();

329+

});

330+331+

it("honors plugin registry postinstall migration disable env", async () => {

332+

await expect(

333+

runPluginRegistryPostinstallMigration({

334+

env: { OPENCLAW_DISABLE_PLUGIN_REGISTRY_MIGRATION: "1" },

335+

log: { log: vi.fn(), warn: vi.fn() },

336+

}),

337+

).resolves.toEqual({ status: "disabled" });

338+

});

339+250340

it("prunes stale dist files from packaged installs", async () => {

251341

const packageRoot = await createTempDirAsync("openclaw-packaged-install-");

252342

const currentFile = path.join(packageRoot, "dist", "channel-BOa4MfoC.js");