From 71c74b766e1fe9e7dda55f9e750589bee9e4af6c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Apr 2026 21:12:09 +0100 Subject: [PATCH] fix(plugins): avoid hand-built extension path markers --- src/plugins/bundled-runtime-deps.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/bundled-runtime-deps.ts b/src/plugins/bundled-runtime-deps.ts index 26e6e7cacea..1e9c8016608 100644 --- a/src/plugins/bundled-runtime-deps.ts +++ b/src/plugins/bundled-runtime-deps.ts @@ -68,6 +68,7 @@ const BUNDLED_RUNTIME_DEPS_LOCK_STALE_MS = 10 * 60_000; const BUNDLED_RUNTIME_DEPS_OWNERLESS_LOCK_STALE_MS = 30_000; const BUNDLED_RUNTIME_DEPS_INSTALL_PROGRESS_INTERVAL_MS = 5_000; const BUNDLED_RUNTIME_MIRROR_MATERIALIZED_EXTENSIONS = new Set([".cjs", ".js", ".mjs"]); +const BUNDLED_EXTENSION_DIST_DIR = "extensions"; const BUNDLED_RUNTIME_MIRROR_PLUGIN_REGION_RE = /(?:^|\n)\/\/#region extensions\/[^/\s]+(?:\/|$)/u; const MIRRORED_CORE_RUNTIME_DEP_NAMES = ["tslog"] as const; const MIRRORED_PACKAGE_RUNTIME_DEP_PLUGIN_ID = "openclaw-core"; @@ -569,11 +570,13 @@ function isPluginOwnedDistImporter(params: { source: string; pluginIds: readonly string[]; }): boolean { - return params.pluginIds.some( - (pluginId) => - params.relativePath.startsWith(`extensions/${pluginId}/`) || - params.source.includes(`//#region extensions/${pluginId}/`), - ); + return params.pluginIds.some((pluginId) => { + const pluginPathPrefix = `${BUNDLED_EXTENSION_DIST_DIR}/${pluginId}/`; + return ( + params.relativePath.startsWith(pluginPathPrefix) || + params.source.includes(`//#region ${pluginPathPrefix}`) + ); + }); } function collectBundledRuntimeDependencyOwners(packageRoot: string): Map<