From 62b1618fbdb41deb86266eda390e4545c56bd319 Mon Sep 17 00:00:00 2001 From: "Daniel M." <113709296+Manantra@users.noreply.github.com> Date: Mon, 16 Feb 2026 06:34:26 +0100 Subject: [PATCH] Fix installer overwriting package.json and losing openclaw.extensions (#1113) The update step copies the root package.json over the extension's package.json, wiping the openclaw.extensions field that plugin discovery requires. This causes "plugin not found: claude-mem" after every update. Merge only the version number instead. Fixes #1106 --- openclaw/install.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/openclaw/install.sh b/openclaw/install.sh index 51da77b5..1c0fbf84 100755 --- a/openclaw/install.sh +++ b/openclaw/install.sh @@ -812,8 +812,18 @@ install_plugin() { # Copy plugin/ directory (worker service, hooks, scripts, skills, UI) cp -R "${repo_root}/plugin" "${extension_dir}/" - # Copy root package.json (contains the canonical version number) - cp "${repo_root}/package.json" "${extension_dir}/package.json" + # Merge the canonical version from root package.json into the existing + # extension package.json, preserving the openclaw.extensions field that + # plugin discovery requires. + local root_version + root_version="$(node -e "console.log(require('${repo_root}/package.json').version)")" + node -e " + const fs = require('fs'); + const pkgPath = '${extension_dir}/package.json'; + const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); + pkg.version = '${root_version}'; + fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n'); + " success "Core plugin files updated at ${extension_dir}" else