mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 06:31:11 +00:00
fix(update): ignore plugin install stages in dist verify
This commit is contained in:
parent
8368026986
commit
26e4eb8e40
5 changed files with 64 additions and 4 deletions
|
|
@ -74,6 +74,7 @@ Docs: https://docs.openclaw.ai
|
|||
|
||||
### Fixes
|
||||
|
||||
- Update: ignore bundled plugin `.openclaw-install-stage` directories during global install verification and packaged dist pruning so leftover runtime-dep staging files do not turn successful updates into `unexpected packaged dist file` failures. Fixes #71752. Thanks @waynegault.
|
||||
- Gateway/plugins: stop persisted WhatsApp auth state from activating bundled channel runtime-dependency repair during startup when `channels.whatsapp` is absent, avoiding npm/git stalls on packaged Linux installs. Fixes #71994. Thanks @xiao398008.
|
||||
- CLI/model runs: keep `openclaw infer model run` on explicit OpenRouter models from loading the full provider catalog or inheriting chat-agent silent-reply policy, restoring non-empty one-shot probe output. Fixes #68791. Thanks @limpredator.
|
||||
- Installer/macOS: rerun Homebrew install steps without the gum spinner when raw-mode ioctl failures occur, and avoid claiming `node@24` was installed when the Homebrew keg binary is missing. Fixes #70411. Thanks @1fanwang and @dad-io.
|
||||
|
|
|
|||
|
|
@ -187,8 +187,8 @@ function assertSafeInstalledDistPath(relativePath, params) {
|
|||
return candidatePath;
|
||||
}
|
||||
|
||||
function isStagedRuntimeNodeModulesPath(relativePath) {
|
||||
return /^dist\/extensions\/[^/]+\/node_modules(?:\/|$)/u.test(
|
||||
function isStagedRuntimeDependencyPath(relativePath) {
|
||||
return /^dist\/extensions\/[^/]+\/(?:node_modules|\.openclaw-install-stage(?:-[^/]+)?)(?:\/|$)/u.test(
|
||||
normalizeRelativePath(relativePath),
|
||||
);
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ function listInstalledDistFiles(params = {}) {
|
|||
continue;
|
||||
}
|
||||
const relativeCurrentDir = normalizeRelativePath(relative(packageRoot, currentDir));
|
||||
if (isStagedRuntimeNodeModulesPath(relativeCurrentDir)) {
|
||||
if (isStagedRuntimeDependencyPath(relativeCurrentDir)) {
|
||||
continue;
|
||||
}
|
||||
for (const entry of readDir(currentDir, { withFileTypes: true })) {
|
||||
|
|
@ -247,7 +247,7 @@ function pruneEmptyDistDirectories(params = {}) {
|
|||
|
||||
function prune(currentDir) {
|
||||
const relativeCurrentDir = normalizeRelativePath(relative(packageRoot, currentDir));
|
||||
if (isStagedRuntimeNodeModulesPath(relativeCurrentDir)) {
|
||||
if (isStagedRuntimeDependencyPath(relativeCurrentDir)) {
|
||||
return;
|
||||
}
|
||||
for (const entry of readDir(currentDir, { withFileTypes: true })) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const OMITTED_PRIVATE_QA_DIST_PREFIXES = ["dist/qa-runtime-"];
|
|||
const OMITTED_DIST_SUBTREE_PATTERNS = [
|
||||
/^dist\/extensions\/node_modules(?:\/|$)/u,
|
||||
/^dist\/extensions\/[^/]+\/node_modules(?:\/|$)/u,
|
||||
/^dist\/extensions\/[^/]+\/\.openclaw-install-stage(?:-[^/]+)?(?:\/|$)/u,
|
||||
/^dist\/extensions\/[^/]+\/\.openclaw-runtime-deps-[^/]+(?:\/|$)/u,
|
||||
/^dist\/extensions\/qa-matrix(?:\/|$)/u,
|
||||
new RegExp(`^dist/plugin-sdk/extensions/${LEGACY_QA_LAB_DIR}(?:/|$)`, "u"),
|
||||
|
|
|
|||
|
|
@ -425,6 +425,34 @@ describe("update global helpers", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("ignores bundled plugin install stages during installed dist verification", async () => {
|
||||
await withTempDir({ prefix: "openclaw-update-global-plugin-stage-" }, async (packageRoot) => {
|
||||
await writeGlobalPackageJson(packageRoot);
|
||||
await writeCompatSidecars(packageRoot);
|
||||
await fs.mkdir(path.join(packageRoot, "dist", "extensions", "brave"), { recursive: true });
|
||||
await writePackageDistInventory(packageRoot);
|
||||
|
||||
for (const stageDir of [".openclaw-install-stage", ".openclaw-install-stage-retry"]) {
|
||||
const stagedFile = path.join(
|
||||
packageRoot,
|
||||
"dist",
|
||||
"extensions",
|
||||
"brave",
|
||||
stageDir,
|
||||
"node_modules",
|
||||
"typebox",
|
||||
"build",
|
||||
"compile",
|
||||
"code.mjs",
|
||||
);
|
||||
await fs.mkdir(path.dirname(stagedFile), { recursive: true });
|
||||
await fs.writeFile(stagedFile, "export {};\n", "utf8");
|
||||
}
|
||||
|
||||
await expect(collectInstalledGlobalPackageErrors({ packageRoot })).resolves.toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
it("does not require private QA sidecars when the inventory is missing", async () => {
|
||||
await withTempDir({ prefix: "openclaw-update-global-legacy-" }, async (packageRoot) => {
|
||||
await writeGlobalPackageJson(packageRoot);
|
||||
|
|
|
|||
|
|
@ -550,11 +550,39 @@ describe("bundled plugin postinstall", () => {
|
|||
const staleFile = path.join(packageRoot, "dist", "stale-runtime.js");
|
||||
const packageJson = path.join(packageRoot, "dist", "extensions", "slack", "package.json");
|
||||
const binDir = path.join(packageRoot, "dist", "extensions", "slack", "node_modules", ".bin");
|
||||
const installStageFile = path.join(
|
||||
packageRoot,
|
||||
"dist",
|
||||
"extensions",
|
||||
"slack",
|
||||
".openclaw-install-stage",
|
||||
"node_modules",
|
||||
"typebox",
|
||||
"build",
|
||||
"compile",
|
||||
"code.mjs",
|
||||
);
|
||||
const retryInstallStageFile = path.join(
|
||||
packageRoot,
|
||||
"dist",
|
||||
"extensions",
|
||||
"slack",
|
||||
".openclaw-install-stage-retry",
|
||||
"node_modules",
|
||||
"typebox",
|
||||
"build",
|
||||
"compile",
|
||||
"code.mjs",
|
||||
);
|
||||
await fs.mkdir(path.dirname(staleFile), { recursive: true });
|
||||
await fs.mkdir(path.dirname(packageJson), { recursive: true });
|
||||
await fs.mkdir(binDir, { recursive: true });
|
||||
await fs.mkdir(path.dirname(installStageFile), { recursive: true });
|
||||
await fs.mkdir(path.dirname(retryInstallStageFile), { recursive: true });
|
||||
await fs.writeFile(staleFile, "export {};\n");
|
||||
await fs.writeFile(packageJson, "{}\n");
|
||||
await fs.writeFile(installStageFile, "export {};\n");
|
||||
await fs.writeFile(retryInstallStageFile, "export {};\n");
|
||||
await fs.symlink("../fxparser/bin.js", path.join(binDir, "fxparser"));
|
||||
|
||||
expect(
|
||||
|
|
@ -564,6 +592,8 @@ describe("bundled plugin postinstall", () => {
|
|||
log: { log: vi.fn(), warn: vi.fn() },
|
||||
}),
|
||||
).toEqual(["dist/stale-runtime.js"]);
|
||||
await expect(fs.stat(installStageFile)).resolves.toBeDefined();
|
||||
await expect(fs.stat(retryInstallStageFile)).resolves.toBeDefined();
|
||||
});
|
||||
|
||||
it("unlinks stale files instead of recursive pruning them", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue