


















@@ -31,6 +31,20 @@ function writeBundledChannelPlugin(root: string, id: string, dependencies: Recor
3131});
3232}
333334+function writeDefaultEnabledBundledChannelPlugin(
35+root: string,
36+id: string,
37+dependencies: Record<string, string>,
38+) {
39+writeBundledChannelPlugin(root, id, dependencies);
40+writeJson(path.join(root, "dist", "extensions", id, "openclaw.plugin.json"), {
41+ id,
42+channels: [id],
43+enabledByDefault: true,
44+configSchema: { type: "object" },
45+});
46+}
47+3448function createInstalledRuntimeDeps(): InstalledRuntimeDeps {
3549return [];
3650}
@@ -153,7 +167,7 @@ describe("doctor bundled plugin runtime deps", () => {
153167expect(result.conflicts).toEqual([]);
154168});
155169156-it("can include disabled but configured bundled channel deps for doctor recovery", () => {
170+it("does not include explicitly disabled but configured bundled channel deps", () => {
157171const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
158172writeJson(path.join(root, "package.json"), { name: "openclaw" });
159173writeBundledChannelPlugin(root, "telegram", { "telegram-only": "1.0.0" });
@@ -169,12 +183,77 @@ describe("doctor bundled plugin runtime deps", () => {
169183},
170184});
171185186+expect(result.missing).toEqual([]);
187+expect(result.conflicts).toEqual([]);
188+});
189+190+it("includes configured bundled channel deps for doctor recovery when not explicitly disabled", () => {
191+const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
192+writeJson(path.join(root, "package.json"), { name: "openclaw" });
193+writeBundledChannelPlugin(root, "telegram", { "telegram-only": "1.0.0" });
194+195+const result = scanBundledPluginRuntimeDeps({
196+packageRoot: root,
197+includeConfiguredChannels: true,
198+config: {
199+plugins: { enabled: true },
200+channels: {
201+telegram: { botToken: "123:abc" },
202+},
203+},
204+});
205+172206expect(result.missing.map((dep) => `${dep.name}@${dep.version}`)).toEqual([
173207"telegram-only@1.0.0",
174208]);
175209expect(result.conflicts).toEqual([]);
176210});
177211212+it("does not include configured bundled channel deps when the plugin entry is disabled", () => {
213+const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
214+writeJson(path.join(root, "package.json"), { name: "openclaw" });
215+writeBundledChannelPlugin(root, "telegram", { "telegram-only": "1.0.0" });
216+217+const result = scanBundledPluginRuntimeDeps({
218+packageRoot: root,
219+includeConfiguredChannels: true,
220+config: {
221+plugins: {
222+enabled: true,
223+entries: {
224+telegram: { enabled: false },
225+},
226+},
227+channels: {
228+telegram: { botToken: "123:abc" },
229+},
230+},
231+});
232+233+expect(result.missing).toEqual([]);
234+expect(result.conflicts).toEqual([]);
235+});
236+237+it("lets channel disablement suppress default-enabled bundled channel deps", () => {
238+const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
239+writeJson(path.join(root, "package.json"), { name: "openclaw" });
240+writeDefaultEnabledBundledChannelPlugin(root, "demo", { "demo-only": "1.0.0" });
241+242+const result = scanBundledPluginRuntimeDeps({
243+packageRoot: root,
244+includeConfiguredChannels: true,
245+config: {
246+plugins: { enabled: true },
247+channels: {
248+demo: { enabled: false },
249+},
250+},
251+});
252+253+expect(result.missing).toEqual([]);
254+expect(result.conflicts).toEqual([]);
255+});
256+178257it("reports default-enabled bundled plugin deps", () => {
179258const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
180259writeJson(path.join(root, "package.json"), { name: "openclaw" });
@@ -324,7 +403,7 @@ describe("doctor bundled plugin runtime deps", () => {
324403{
325404installRoot: root,
326405missingSpecs: ["grammy@1.37.0"],
327-installSpecs: ["@slack/web-api@7.15.1", "grammy@1.37.0"],
406+installSpecs: ["grammy@1.37.0"],
328407},
329408]);
330409});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。