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

推荐订阅源

N
Netflix TechBlog - Medium
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
F
Fortinet All Blogs
D
Docker
博客园 - 司徒正美
腾讯CDC
Recent Announcements
Recent Announcements
The Cloudflare Blog
B
Blog RSS Feed
GbyAI
GbyAI
T
Tailwind CSS Blog
雷峰网
雷峰网
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志

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(plugins): migrate only enabled registry entries · ope...
vincentkoc · 2026-04-25 · via Recent Commits to openclaw:main

@@ -34,7 +34,7 @@ function hermeticEnv(overrides: NodeJS.ProcessEnv = {}): NodeJS.ProcessEnv {

3434

};

3535

}

363637-

function createCandidate(rootDir: string): PluginCandidate {

37+

function createCandidate(rootDir: string, id = "demo"): PluginCandidate {

3838

fs.writeFileSync(

3939

path.join(rootDir, "index.ts"),

4040

"throw new Error('runtime entry should not load while migrating plugin registry');\n",

@@ -43,15 +43,15 @@ function createCandidate(rootDir: string): PluginCandidate {

4343

fs.writeFileSync(

4444

path.join(rootDir, "openclaw.plugin.json"),

4545

JSON.stringify({

46-

id: "demo",

47-

name: "Demo",

46+

id,

47+

name: id,

4848

configSchema: { type: "object" },

49-

providers: ["demo"],

49+

providers: [id],

5050

}),

5151

"utf8",

5252

);

5353

return {

54-

idHint: "demo",

54+

idHint: id,

5555

source: path.join(rootDir, "index.ts"),

5656

rootDir,

5757

origin: "global",

@@ -83,6 +83,45 @@ describe("plugin registry install migration", () => {

8383

expect(readConfig).not.toHaveBeenCalled();

8484

});

858586+

it("persists only plugins enabled by the central config policy", async () => {

87+

const stateDir = makeTempDir();

88+

const enabledDir = path.join(stateDir, "plugins", "enabled-demo");

89+

const disabledDir = path.join(stateDir, "plugins", "disabled-demo");

90+

fs.mkdirSync(enabledDir, { recursive: true });

91+

fs.mkdirSync(disabledDir, { recursive: true });

92+93+

await expect(

94+

migratePluginRegistryForInstall({

95+

stateDir,

96+

candidates: [

97+

createCandidate(enabledDir, "enabled-demo"),

98+

createCandidate(disabledDir, "disabled-demo"),

99+

],

100+

readConfig: async () => ({

101+

plugins: {

102+

entries: {

103+

"disabled-demo": {

104+

enabled: false,

105+

},

106+

},

107+

},

108+

}),

109+

env: hermeticEnv(),

110+

}),

111+

).resolves.toMatchObject({

112+

status: "migrated",

113+

current: {

114+

plugins: [expect.objectContaining({ pluginId: "enabled-demo" })],

115+

},

116+

});

117+118+

await expect(readPersistedInstalledPluginIndex({ stateDir })).resolves.toMatchObject({

119+

plugins: [expect.objectContaining({ pluginId: "enabled-demo" })],

120+

});

121+

const persisted = await readPersistedInstalledPluginIndex({ stateDir });

122+

expect(persisted?.plugins.map((plugin) => plugin.pluginId)).toEqual(["enabled-demo"]);

123+

});

124+86125

it("supports dry-run preflight without reading config or writing the registry", async () => {

87126

const stateDir = makeTempDir();

88127

const readConfig = vi.fn(async () => ({}));