Skip to content

Commit fa93dfe

Browse files
committed
fix(update-cli): skip package.json check for bundle plugins in payload scan
collectMissingPluginInstallPayloads now treats bundle-format install paths as valid payloads, matching runtime behavior and preventing openclaw update from false-failing on healthy bundle plugins. Refs #97985
1 parent 696e1bc commit fa93dfe

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

‎src/cli/update-cli/update-command.test.ts‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,46 @@ describe("collectMissingPluginInstallPayloads", () => {
297297
}
298298
});
299299

300+
it("does not report missing package.json for bundle-format plugins", async () => {
301+
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-update-bundle-payload-"));
302+
const claudeBundleDir = path.join(tmpDir, "extensions", "claude-bundle");
303+
const codexBundleDir = path.join(tmpDir, "extensions", "codex-bundle");
304+
try {
305+
await fs.mkdir(path.join(claudeBundleDir, ".claude-plugin"), { recursive: true });
306+
await fs.writeFile(
307+
path.join(claudeBundleDir, ".claude-plugin", "plugin.json"),
308+
JSON.stringify({ name: "claude-bundle" }),
309+
"utf8",
310+
);
311+
await fs.mkdir(path.join(codexBundleDir, ".codex-plugin"), { recursive: true });
312+
await fs.writeFile(
313+
path.join(codexBundleDir, ".codex-plugin", "plugin.json"),
314+
JSON.stringify({ name: "codex-bundle", skills: "skills" }),
315+
"utf8",
316+
);
317+
318+
await expect(
319+
collectMissingPluginInstallPayloads({
320+
env: { HOME: tmpDir } as NodeJS.ProcessEnv,
321+
records: {
322+
"claude-bundle": {
323+
source: "npm",
324+
spec: "claude-bundle@beta",
325+
installPath: claudeBundleDir,
326+
},
327+
"codex-bundle": {
328+
source: "npm",
329+
spec: "codex-bundle@beta",
330+
installPath: codexBundleDir,
331+
},
332+
},
333+
}),
334+
).resolves.toEqual([]);
335+
} finally {
336+
await fs.rm(tmpDir, { recursive: true, force: true });
337+
}
338+
});
339+
300340
it("skips disabled tracked records when requested", async () => {
301341
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-update-plugin-payload-"));
302342
const missingDir = path.join(tmpDir, "state", "npm", "node_modules", "@openclaw", "missing");

‎src/cli/update-cli/update-command.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ import {
140140
import { commitPluginInstallRecordsWithConfig } from "../plugins-install-record-commit.js";
141141
import { listPersistedBundledPluginLocationBridges } from "../plugins-location-bridges.js";
142142
import { refreshPluginRegistryAfterConfigMutation } from "../plugins-registry-refresh.js";
143+
import { resolvePluginInstallPayloadKind } from "./plugin-payload-kind.js";
143144
import {
144145
convergenceWarningsToOutcomes,
145146
runPostCorePluginConvergence,
@@ -574,6 +575,9 @@ export async function collectMissingPluginInstallPayloads(params: {
574575
missing.push({ pluginId, installPath, reason: "missing-package-dir" });
575576
continue;
576577
}
578+
if (resolvePluginInstallPayloadKind(installPath) === "bundle") {
579+
continue;
580+
}
577581
const packageJsonPath = path.join(installPath, "package.json");
578582
if (!(await pathExists(packageJsonPath))) {
579583
missing.push({ pluginId, installPath, reason: "missing-package-json" });

0 commit comments

Comments
 (0)