fix: allow package public surface hardlinks

OpenClaw v2026.5.4 resolves bundled plugin public artifacts under the package-root extension surface. In the Nix store those artifacts may be hardlinked, so allow hardlinks for resolved module paths inside OPENCLAW_PACKAGE_ROOT while keeping the existing hardlink rejection elsewhere.

Tests: nix build .#checks.aarch64-darwin.gateway-smoke --accept-flake-config --no-link --print-out-paths; nix build .#checks.aarch64-darwin.ci --accept-flake-config --no-link --print-out-paths; nix build .#packages.x86_64-linux.openclaw .#checks.x86_64-linux.bin-surface .#checks.x86_64-linux.gateway-smoke --accept-flake-config --no-link --print-out-paths; scripts/check-flake-lock-owners.sh; scripts/hm-activation-macos.sh
This commit is contained in:
joshp123 2026-05-05 19:22:03 +02:00
parent 8264853833
commit 4a918c46ee

View File

@ -2,12 +2,14 @@ diff --git a/src/plugins/public-surface-loader.ts b/src/plugins/public-surface-l
index 1f5b5ab..c9727e1 100644
--- a/src/plugins/public-surface-loader.ts
+++ b/src/plugins/public-surface-loader.ts
@@ -116,13 +116,13 @@ export function loadBundledPluginPublicArtifactModuleSync<T extends object>(para
@@ -116,13 +116,16 @@ export function loadBundledPluginPublicArtifactModuleSync<T extends object>(para
if (cached) {
return cached as T;
}
-
+ const isPackagePublicSurface = location.boundaryRoot === OPENCLAW_PACKAGE_ROOT;
+ const packageRoot = path.resolve(OPENCLAW_PACKAGE_ROOT);
+ const resolvedModulePath = path.resolve(location.modulePath);
+ const isPackagePublicSurface = resolvedModulePath.startsWith(`${packageRoot}${path.sep}`);
+
const opened = openBoundaryFileSync({
absolutePath: location.modulePath,
@ -15,7 +17,8 @@ index 1f5b5ab..c9727e1 100644
- boundaryLabel:
- location.boundaryRoot === OPENCLAW_PACKAGE_ROOT ? "OpenClaw package root" : "plugin root",
- rejectHardlinks: true,
+ boundaryLabel: isPackagePublicSurface ? "OpenClaw package root" : "plugin root",
+ boundaryLabel:
+ location.boundaryRoot === OPENCLAW_PACKAGE_ROOT ? "OpenClaw package root" : "plugin root",
+ rejectHardlinks: !isPackagePublicSurface,
});
if (!opened.ok) {