























@@ -101,18 +101,13 @@ import type { PluginManifestRecord } from "../../plugins/manifest-registry.js";
101101import { clearPluginMetadataLifecycleCaches } from "../../plugins/plugin-metadata-lifecycle.js";
102102import { createEmptyPluginRegistry } from "../../plugins/registry.js";
103103import {
104-pinActivePluginChannelRegistry,
105-releasePinnedPluginChannelRegistry,
106104setActivePluginRegistry,
107105} from "../../plugins/runtime.js";
108-import { createPluginRecord } from "../../plugins/status.test-helpers.js";
109106import type { WizardPrompter } from "../../wizard/prompts.js";
110107import { makePrompter, makeRuntime } from "../setup/__tests__/test-utils.js";
111108import {
112109ensureChannelSetupPluginInstalled,
113110loadChannelSetupPluginRegistrySnapshotForChannel,
114-reloadChannelSetupPluginRegistry,
115-reloadChannelSetupPluginRegistryForChannel,
116111} from "./plugin-install.js";
117112118113const bundledChatNpmSpec = "@openclaw/bundled-chat@1.2.3";
@@ -721,27 +716,7 @@ describe("ensureChannelSetupPluginInstalled", () => {
721716expect(result.pluginId).toBe("wecom-openclaw-plugin");
722717});
723718724-it("reloads the setup plugin registry without using plugin registry cache", () => {
725-const runtime = makeRuntime();
726-const cfg: OpenClawConfig = {};
727-728-reloadChannelSetupPluginRegistry({
729- cfg,
730- runtime,
731-workspaceDir: "/tmp/openclaw-workspace",
732-});
733-734-expectLoadOpenClawPluginFields({
735-config: cfg,
736-activationSourceConfig: cfg,
737-autoEnabledReasons: {},
738-workspaceDir: "/tmp/openclaw-workspace",
739-cache: false,
740-includeSetupOnlyChannelPlugins: true,
741-});
742-});
743-744-it("loads the setup plugin registry from the auto-enabled config snapshot", () => {
719+it("loads setup snapshots from the auto-enabled config snapshot", () => {
745720const runtime = makeRuntime();
746721const cfg: OpenClawConfig = {
747722plugins: {},
@@ -761,9 +736,10 @@ describe("ensureChannelSetupPluginInstalled", () => {
761736autoEnabledReasons: {},
762737});
763738764-reloadChannelSetupPluginRegistry({
739+loadChannelSetupPluginRegistrySnapshotForChannel({
765740 cfg,
766741 runtime,
742+channel: "external-chat",
767743workspaceDir: "/tmp/openclaw-workspace",
768744});
769745@@ -775,94 +751,7 @@ describe("ensureChannelSetupPluginInstalled", () => {
775751config: autoEnabledConfig,
776752activationSourceConfig: cfg,
777753autoEnabledReasons: {},
778-});
779-});
780-781-it("scopes channel reloads when setup starts from an empty registry", () => {
782-const runtime = makeRuntime();
783-const cfg: OpenClawConfig = {};
784-getChannelPluginCatalogEntry.mockReturnValue({ pluginId: "@vendor/external-chat-plugin" });
785-786-reloadChannelSetupPluginRegistryForChannel({
787- cfg,
788- runtime,
789-channel: "external-chat",
790-workspaceDir: "/tmp/openclaw-workspace",
791-});
792-793-expectLoadOpenClawPluginFields({
794-config: cfg,
795-activationSourceConfig: cfg,
796-autoEnabledReasons: {},
797-workspaceDir: "/tmp/openclaw-workspace",
798-cache: false,
799-onlyPluginIds: ["@vendor/external-chat-plugin"],
800-includeSetupOnlyChannelPlugins: true,
801-});
802-expect(getChannelPluginCatalogEntry).toHaveBeenCalledWith("external-chat", {
803-workspaceDir: "/tmp/openclaw-workspace",
804-});
805-});
806-807-it("does not widen channel reloads when the active plugin registry is already populated", () => {
808-const runtime = makeRuntime();
809-const cfg: OpenClawConfig = {};
810-const registry = createEmptyPluginRegistry();
811-registry.plugins.push(
812-createPluginRecord({
813-id: "loaded",
814-name: "loaded",
815-source: "/tmp/loaded.cjs",
816-origin: "bundled",
817-configSchema: true,
818-}),
819-);
820-setActivePluginRegistry(registry);
821-822-reloadChannelSetupPluginRegistryForChannel({
823- cfg,
824- runtime,
825-channel: "external-chat",
826-workspaceDir: "/tmp/openclaw-workspace",
827-});
828-829-expectLoadOpenClawPluginFields({
830-onlyPluginIds: [],
831-});
832-});
833-834-it("scopes channel reloads when the global registry is populated but the pinned channel registry is empty", () => {
835-const runtime = makeRuntime();
836-const cfg: OpenClawConfig = {};
837-getChannelPluginCatalogEntry.mockReturnValue({ pluginId: "@vendor/external-chat-plugin" });
838-const activeRegistry = createEmptyPluginRegistry();
839-activeRegistry.plugins.push(
840-createPluginRecord({
841-id: "loaded-tools",
842-name: "loaded-tools",
843-source: "/tmp/loaded-tools.cjs",
844-origin: "bundled",
845-}),
846-);
847-setActivePluginRegistry(activeRegistry);
848-const pinnedChannelRegistry = createEmptyPluginRegistry();
849-pinActivePluginChannelRegistry(pinnedChannelRegistry);
850-851-try {
852-reloadChannelSetupPluginRegistryForChannel({
853- cfg,
854- runtime,
855-channel: "external-chat",
856-workspaceDir: "/tmp/openclaw-workspace",
857-});
858-} finally {
859-releasePinnedPluginChannelRegistry(pinnedChannelRegistry);
860-}
861-862-expectLoadOpenClawPluginFields({
863-activationSourceConfig: cfg,
864-autoEnabledReasons: {},
865-onlyPluginIds: ["@vendor/external-chat-plugin"],
754+activate: false,
866755});
867756});
868757此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。