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

推荐订阅源

V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
罗磊的独立博客
小众软件
小众软件
I
InfoQ
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
P
Proofpoint News Feed
博客园 - 司徒正美
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
Jina AI
Jina AI
N
Netflix TechBlog - Medium

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
refactor: route bundled catalogs through plugin registry ...
steipete · 2026-05-02 · via Recent Commits to openclaw:main

@@ -1,10 +1,13 @@

11

import { importFreshModule } from "openclaw/plugin-sdk/test-fixtures";

22

import { beforeEach, describe, expect, it, vi } from "vitest";

3-

import type { BundledPluginMetadata } from "../plugins/bundled-plugin-metadata.js";

3+

import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";

44

import type { PluginManifestChannelConfig } from "../plugins/manifest.js";

556-

const listBundledPluginMetadataMock = vi.hoisted(() =>

7-

vi.fn<(options?: unknown) => readonly BundledPluginMetadata[]>(() => []),

6+

const loadPluginManifestRegistryMock = vi.hoisted(() =>

7+

vi.fn<(options?: Record<string, unknown>) => PluginManifestRegistry>(() => ({

8+

plugins: [],

9+

diagnostics: [],

10+

})),

811

);

912

const collectBundledChannelConfigsMock = vi.hoisted(() =>

1013

vi.fn<(params: unknown) => Record<string, PluginManifestChannelConfig> | undefined>(

@@ -14,10 +17,15 @@ const collectBundledChannelConfigsMock = vi.hoisted(() =>

14171518

describe("ChannelsSchema bundled runtime loading", () => {

1619

beforeEach(() => {

17-

listBundledPluginMetadataMock.mockClear();

20+

loadPluginManifestRegistryMock.mockClear();

21+

loadPluginManifestRegistryMock.mockReturnValue({

22+

plugins: [],

23+

diagnostics: [],

24+

});

1825

collectBundledChannelConfigsMock.mockClear();

19-

vi.doMock("../plugins/bundled-plugin-metadata.js", () => ({

20-

listBundledPluginMetadata: (options?: unknown) => listBundledPluginMetadataMock(options),

26+

vi.doMock("../plugins/plugin-registry.js", () => ({

27+

loadPluginManifestRegistryForPluginRegistry: (options?: Record<string, unknown>) =>

28+

loadPluginManifestRegistryMock(options),

2129

}));

2230

vi.doMock("../plugins/bundled-channel-config-metadata.js", () => ({

2331

collectBundledChannelConfigs: (params: unknown) => collectBundledChannelConfigsMock(params),

@@ -42,18 +50,20 @@ describe("ChannelsSchema bundled runtime loading", () => {

4250

});

43514452

expect(parsed?.defaults?.groupPolicy).toBe("open");

45-

expect(listBundledPluginMetadataMock).not.toHaveBeenCalledWith(

53+

expect(loadPluginManifestRegistryMock).not.toHaveBeenCalledWith(

4654

expect.objectContaining({

47-

includeChannelConfigs: true,

55+

bundledChannelConfigCollector: expect.any(Function),

4856

}),

4957

);

5058

});

51595260

it("loads bundled channel runtime discovery only when plugin-owned channel config is present", async () => {

53-

listBundledPluginMetadataMock.mockReturnValueOnce([

54-

{

55-

dirName: "discord",

56-

manifest: {

61+

loadPluginManifestRegistryMock.mockReturnValueOnce({

62+

diagnostics: [],

63+

plugins: [

64+

{

65+

id: "discord",

66+

origin: "bundled",

5767

channels: ["discord"],

5868

channelConfigs: {

5969

discord: {

@@ -62,9 +72,9 @@ describe("ChannelsSchema bundled runtime loading", () => {

6272

},

6373

},

6474

},

65-

},

66-

} as unknown as BundledPluginMetadata,

67-

]);

75+

} as unknown as PluginManifestRegistry["plugins"][number],

76+

],

77+

});

68786979

const runtime = await importFreshModule<typeof import("./zod-schema.providers.js")>(

7080

import.meta.url,

@@ -75,24 +85,16 @@ describe("ChannelsSchema bundled runtime loading", () => {

7585

discord: {},

7686

});

778778-

expect(listBundledPluginMetadataMock.mock.calls).toContainEqual([

88+

expect(loadPluginManifestRegistryMock.mock.calls).toContainEqual([

7989

expect.objectContaining({

80-

includeChannelConfigs: false,

81-

includeSyntheticChannelConfigs: false,

90+

includeDisabled: true,

91+

bundledChannelConfigCollector: expect.any(Function),

8292

}),

8393

]);

8494

expect(collectBundledChannelConfigsMock).not.toHaveBeenCalled();

8595

});

86968797

it("loads a single plugin-owned runtime surface when the manifest omits runtime metadata", async () => {

88-

listBundledPluginMetadataMock.mockReturnValueOnce([

89-

{

90-

dirName: "discord",

91-

manifest: {

92-

channels: ["discord"],

93-

},

94-

} as unknown as BundledPluginMetadata,

95-

]);

9698

collectBundledChannelConfigsMock.mockReturnValueOnce({

9799

discord: {

98100

schema: {},

@@ -101,6 +103,24 @@ describe("ChannelsSchema bundled runtime loading", () => {

101103

},

102104

},

103105

});

106+

loadPluginManifestRegistryMock.mockImplementationOnce((options) => ({

107+

diagnostics: [],

108+

plugins: [

109+

{

110+

id: "discord",

111+

origin: "bundled",

112+

channels: ["discord"],

113+

channelConfigs: (

114+

options?.bundledChannelConfigCollector as

115+

| ((params: unknown) => Record<string, PluginManifestChannelConfig> | undefined)

116+

| undefined

117+

)?.({

118+

pluginDir: "/repo/extensions/discord",

119+

manifest: { id: "discord", channels: ["discord"] },

120+

}),

121+

} as unknown as PluginManifestRegistry["plugins"][number],

122+

],

123+

}));

104124105125

const runtime = await importFreshModule<typeof import("./zod-schema.providers.js")>(

106126

import.meta.url,

@@ -111,10 +131,10 @@ describe("ChannelsSchema bundled runtime loading", () => {

111131

discord: {},

112132

});

113133114-

expect(listBundledPluginMetadataMock.mock.calls).toContainEqual([

134+

expect(loadPluginManifestRegistryMock.mock.calls).toContainEqual([

115135

expect.objectContaining({

116-

includeChannelConfigs: false,

117-

includeSyntheticChannelConfigs: false,

136+

includeDisabled: true,

137+

bundledChannelConfigCollector: expect.any(Function),

118138

}),

119139

]);

120140

expect(collectBundledChannelConfigsMock).toHaveBeenCalledTimes(1);