fix(plugins): avoid bundled install load path aliases

This commit is contained in:
Vincent Koc
2026-04-28 01:20:00 -07:00
parent 169dba2042
commit bab403d0ee
4 changed files with 5 additions and 17 deletions

View File

@@ -502,9 +502,7 @@ describe("plugins cli install", () => {
const writtenConfig = writeConfigFile.mock.calls.at(-1)?.[0] as OpenClawConfig;
expect(writtenConfig.plugins?.entries?.["memory-lancedb"]).toBeUndefined();
expect(writtenConfig.plugins?.load?.paths).toEqual(
expect.arrayContaining(["/existing/plugin", expect.stringContaining("memory-lancedb")]),
);
expect(writtenConfig.plugins?.load?.paths).toEqual(["/existing/plugin"]);
expect(writePersistedInstalledPluginIndexInstallRecords).toHaveBeenCalledWith({
"memory-lancedb": expect.objectContaining({
source: "path",

View File

@@ -110,8 +110,6 @@ async function installBundledPluginSource(params: {
bundledSource: BundledPluginSource;
warning: string;
}) {
const existing = params.snapshot.config.plugins?.load?.paths ?? [];
const mergedPaths = Array.from(new Set([...existing, params.bundledSource.localPath]));
const existingEntry = params.snapshot.config.plugins?.entries?.[params.bundledSource.pluginId];
const shouldEnable = hasValidBundledPluginConfig({
bundledSource: params.bundledSource,
@@ -125,16 +123,7 @@ async function installBundledPluginSource(params: {
: `Installed bundled plugin "${params.bundledSource.pluginId}" without enabling it because it requires configuration first. Configure it, then run \`openclaw plugins enable ${params.bundledSource.pluginId}\`.`;
await persistPluginInstall({
snapshot: {
config: {
...configBase,
plugins: {
...configBase.plugins,
load: {
...configBase.plugins?.load,
paths: mergedPaths,
},
},
},
config: configBase,
baseHash: params.snapshot.baseHash,
},
pluginId: params.bundledSource.pluginId,