


























@@ -286,6 +286,72 @@ describe("doctor bundled plugin runtime deps", () => {
286286expect(result.conflicts).toEqual([]);
287287});
288288289+it("does not report allowlist-excluded default-enabled bundled plugin deps", () => {
290+const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
291+writeJson(path.join(root, "package.json"), { name: "openclaw" });
292+writeJson(path.join(root, "dist", "extensions", "openai", "package.json"), {
293+dependencies: {
294+"openai-only": "1.0.0",
295+},
296+});
297+writeJson(path.join(root, "dist", "extensions", "openai", "openclaw.plugin.json"), {
298+id: "openai",
299+enabledByDefault: true,
300+configSchema: { type: "object" },
301+});
302+303+const result = scanBundledPluginRuntimeDeps({
304+packageRoot: root,
305+config: {
306+plugins: { enabled: true, allow: ["browser"] },
307+},
308+});
309+310+expect(result.missing).toEqual([]);
311+expect(result.conflicts).toEqual([]);
312+});
313+314+it("lets explicit bundled channel enablement bypass runtime-deps allowlist gating", () => {
315+const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
316+writeJson(path.join(root, "package.json"), { name: "openclaw" });
317+writeBundledChannelPlugin(root, "telegram", { "telegram-only": "1.0.0" });
318+319+const result = scanBundledPluginRuntimeDeps({
320+packageRoot: root,
321+config: {
322+plugins: { enabled: true, allow: ["browser"] },
323+channels: {
324+telegram: { enabled: true },
325+},
326+},
327+});
328+329+expect(result.missing.map((dep) => `${dep.name}@${dep.version}`)).toEqual([
330+"telegram-only@1.0.0",
331+]);
332+expect(result.conflicts).toEqual([]);
333+});
334+335+it("does not let doctor channel recovery bypass restrictive plugin allowlists", () => {
336+const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
337+writeJson(path.join(root, "package.json"), { name: "openclaw" });
338+writeBundledChannelPlugin(root, "telegram", { "telegram-only": "1.0.0" });
339+340+const result = scanBundledPluginRuntimeDeps({
341+packageRoot: root,
342+includeConfiguredChannels: true,
343+config: {
344+plugins: { enabled: true, allow: ["browser"] },
345+channels: {
346+telegram: { botToken: "123:abc" },
347+},
348+},
349+});
350+351+expect(result.missing).toEqual([]);
352+expect(result.conflicts).toEqual([]);
353+});
354+289355it("repairs missing deps during non-interactive doctor", async () => {
290356const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-bundled-"));
291357writeJson(path.join(root, "package.json"), { name: "openclaw" });
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。