Skip to content

Commit 644e8f1

Browse files
committed
fix(plugins): pass syncOfficialPluginInstalls when update --all is used (fixes #94083)
1 parent 59fb685 commit 644e8f1

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/cli/plugins-cli.update.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,28 @@ describe("plugins cli update", () => {
980980
expect(updateParams.syncOfficialPluginInstalls).toBeUndefined();
981981
});
982982

983+
it("syncs official catalog specs when --all is used", async () => {
984+
const config = createTrackedPluginConfig({
985+
pluginId: "codex",
986+
spec: "@openclaw/[email protected]",
987+
resolvedName: "@openclaw/codex",
988+
});
989+
loadConfig.mockReturnValue(config);
990+
setInstalledPluginIndexInstallRecords(config.plugins?.installs ?? {});
991+
updateNpmInstalledPlugins.mockResolvedValue({
992+
config,
993+
changed: true,
994+
outcomes: [],
995+
});
996+
primeUpdateConfigSnapshot({ config });
997+
998+
await runPluginsCommand(["plugins", "update", "--all"]);
999+
1000+
const updateParams = expectSingleCallParams(updateNpmInstalledPlugins);
1001+
expect(updateParams.pluginIds).toEqual(["codex"]);
1002+
expect(updateParams.syncOfficialPluginInstalls).toBe(true);
1003+
});
1004+
9831005
it("writes updated config when updater reports changes", async () => {
9841006
const cfg = {
9851007
plugins: {

src/cli/plugins-update-command.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export async function runPluginUpdateCommand(params: {
260260
pluginIds: pluginSelection.pluginIds,
261261
specOverrides: pluginSelection.specOverrides,
262262
dryRun: params.opts.dryRun,
263+
syncOfficialPluginInstalls: params.opts.all ? true : undefined,
263264
dangerouslyForceUnsafeInstall: params.opts.dangerouslyForceUnsafeInstall,
264265
logger,
265266
onIntegrityDrift: async (drift) => {

0 commit comments

Comments
 (0)