





















@@ -2619,4 +2619,93 @@ describe("syncPluginsForUpdateChannel", () => {
26192619spec: "@openclaw/legacy-chat",
26202620});
26212621});
2622+2623+it("removes stale bundled load paths for already-externalized pinned npm installs", async () => {
2624+resolveBundledPluginSourcesMock.mockReturnValue(new Map());
2625+2626+const result = await syncPluginsForUpdateChannel({
2627+channel: "stable",
2628+externalizedBundledPluginBridges: [
2629+{
2630+bundledPluginId: "legacy-chat",
2631+npmSpec: "@openclaw/legacy-chat",
2632+channelIds: ["legacy-chat"],
2633+},
2634+],
2635+config: {
2636+channels: {
2637+"legacy-chat": {
2638+enabled: true,
2639+},
2640+},
2641+plugins: {
2642+load: {
2643+paths: [appBundledPluginRoot("legacy-chat"), "/workspace/plugins/other"],
2644+},
2645+installs: {
2646+"legacy-chat": {
2647+source: "npm",
2648+spec: "@openclaw/legacy-chat@1.2.3",
2649+resolvedSpec: "@openclaw/legacy-chat@1.2.3",
2650+installPath: "/tmp/openclaw-plugins/legacy-chat",
2651+},
2652+},
2653+},
2654+},
2655+});
2656+2657+expect(installPluginFromNpmSpecMock).not.toHaveBeenCalled();
2658+expect(result.changed).toBe(true);
2659+expect(result.config.plugins?.load?.paths).toEqual(["/workspace/plugins/other"]);
2660+expect(result.config.plugins?.installs?.["legacy-chat"]).toMatchObject({
2661+source: "npm",
2662+spec: "@openclaw/legacy-chat@1.2.3",
2663+});
2664+});
2665+2666+it("removes stale bundled load paths for already-externalized pinned ClawHub installs", async () => {
2667+resolveBundledPluginSourcesMock.mockReturnValue(new Map());
2668+2669+const result = await syncPluginsForUpdateChannel({
2670+channel: "stable",
2671+externalizedBundledPluginBridges: [
2672+{
2673+bundledPluginId: "legacy-chat",
2674+preferredSource: "clawhub",
2675+clawhubSpec: "clawhub:legacy-chat",
2676+npmSpec: "@openclaw/legacy-chat",
2677+channelIds: ["legacy-chat"],
2678+},
2679+],
2680+config: {
2681+channels: {
2682+"legacy-chat": {
2683+enabled: true,
2684+},
2685+},
2686+plugins: {
2687+load: {
2688+paths: [appBundledPluginRoot("legacy-chat"), "/workspace/plugins/other"],
2689+},
2690+installs: {
2691+"legacy-chat": {
2692+source: "clawhub",
2693+spec: "clawhub:legacy-chat@2026.5.1",
2694+clawhubPackage: "legacy-chat",
2695+installPath: "/tmp/openclaw-plugins/legacy-chat",
2696+},
2697+},
2698+},
2699+},
2700+});
2701+2702+expect(installPluginFromClawHubMock).not.toHaveBeenCalled();
2703+expect(installPluginFromNpmSpecMock).not.toHaveBeenCalled();
2704+expect(result.changed).toBe(true);
2705+expect(result.config.plugins?.load?.paths).toEqual(["/workspace/plugins/other"]);
2706+expect(result.config.plugins?.installs?.["legacy-chat"]).toMatchObject({
2707+source: "clawhub",
2708+spec: "clawhub:legacy-chat@2026.5.1",
2709+});
2710+});
26222711});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。