From a5693ac807c89dc6d1c5bab3a99c63219b4b0ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Fri, 24 Apr 2026 01:20:26 +0200 Subject: [PATCH] openclaw: 2026.4.21 -> 2026.4.22 Update pattern in stage-bundled-plugin-runtime-deps.mjs to include the new stampPath argument. Add a patch that makes installBundledRuntimeDeps throw when OPENCLAW_SKIP_PLUGIN_CLI=1 is set, so plugin load failures during completion generation get caught and skipped by the plugin loader instead of spawning `npm install` inside the Nix sandbox. Set the env var when invoking `openclaw completion` in postInstall. Co-Authored-By: Claude Opus 4.7 (1M context) --- pkgs/by-name/op/openclaw/package.nix | 18 ++++++++++++------ .../skip-bundled-runtime-install.patch | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 pkgs/by-name/op/openclaw/skip-bundled-runtime-install.patch diff --git a/pkgs/by-name/op/openclaw/package.nix b/pkgs/by-name/op/openclaw/package.nix index 6804b61651ac..4a817f26827e 100644 --- a/pkgs/by-name/op/openclaw/package.nix +++ b/pkgs/by-name/op/openclaw/package.nix @@ -11,7 +11,7 @@ versionCheckHook, rolldown, installShellFiles, - version ? "2026.4.21", + version ? "2026.4.22", }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "openclaw"; @@ -21,10 +21,10 @@ stdenvNoCC.mkDerivation (finalAttrs: { owner = "openclaw"; repo = "openclaw"; tag = "v${finalAttrs.version}"; - hash = "sha256-K1Pl9lXzGKfoq/fXWxYX5PoY3IBzJr0PPstUDGET/gs="; + hash = "sha256-BB+stGBDgMRAPHrVWJS2dFRjw2WrVrFdVf/23Tq1UeA="; }; - pnpmDepsHash = "sha256-FDajXHs4s0+QDRPq4ZxQWWW9rqeSJVYACAl/5Mw2Agc="; + pnpmDepsHash = "sha256-z45mB/w7sorAE3CTliDpvMm9eq+/l9L/mmhYJt0t9O4="; pnpmDeps = fetchPnpmDeps { inherit (finalAttrs) pname version src; @@ -78,6 +78,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { pluginDir, pruneConfig, repoRoot, + stampPath, }) ) { continue; @@ -90,6 +91,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { pluginDir, pruneConfig, repoRoot, + stampPath, }) ) { continue; @@ -135,9 +137,9 @@ stdenvNoCC.mkDerivation (finalAttrs: { in '' installShellCompletion --cmd openclaw \ - --bash <(${emulator} $out/bin/openclaw completion --shell bash) \ - --fish <(${emulator} $out/bin/openclaw completion --shell fish) \ - --zsh <(${emulator} $out/bin/openclaw completion --shell zsh) + --bash <(OPENCLAW_SKIP_PLUGIN_CLI=1 ${emulator} $out/bin/openclaw completion --shell bash) \ + --fish <(OPENCLAW_SKIP_PLUGIN_CLI=1 ${emulator} $out/bin/openclaw completion --shell fish) \ + --zsh <(OPENCLAW_SKIP_PLUGIN_CLI=1 ${emulator} $out/bin/openclaw completion --shell zsh) '' ); @@ -146,6 +148,10 @@ stdenvNoCC.mkDerivation (finalAttrs: { passthru.updateScript = ./update.sh; + patches = [ + ./skip-bundled-runtime-install.patch + ]; + meta = { description = "Self-hosted, open-source AI assistant/agent"; longDescription = '' diff --git a/pkgs/by-name/op/openclaw/skip-bundled-runtime-install.patch b/pkgs/by-name/op/openclaw/skip-bundled-runtime-install.patch new file mode 100644 index 000000000000..539ba54d20c5 --- /dev/null +++ b/pkgs/by-name/op/openclaw/skip-bundled-runtime-install.patch @@ -0,0 +1,17 @@ +diff --git a/src/plugins/bundled-runtime-deps.ts b/src/plugins/bundled-runtime-deps.ts +index 5dca7aa..fac598b 100644 +--- a/src/plugins/bundled-runtime-deps.ts ++++ b/src/plugins/bundled-runtime-deps.ts +@@ -823,6 +823,12 @@ export function installBundledRuntimeDeps(params: { + missingSpecs: string[]; + env: NodeJS.ProcessEnv; + }): void { ++ // Refuse to spawn `npm install` in environments that opt out (e.g. the Nix ++ // build sandbox). Bundled runtime deps are expected to already be staged by ++ // the package build; a runtime install would require network access. ++ if (params.env.OPENCLAW_SKIP_PLUGIN_CLI === "1") { ++ throw new Error("bundled runtime deps install skipped (OPENCLAW_SKIP_PLUGIN_CLI=1)"); ++ } + const installExecutionRoot = params.installExecutionRoot ?? params.installRoot; + fs.mkdirSync(params.installRoot, { recursive: true }); + fs.mkdirSync(installExecutionRoot, { recursive: true });