fix: Found two actionable issues in the bundled runtime-deps staging c (#74526)

Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com>
This commit is contained in:
clawsweeper[bot]
2026-04-29 14:08:57 -07:00
committed by GitHub
parent 27fafa4754
commit 0b48a69ff2
2 changed files with 52 additions and 2 deletions

View File

@@ -190,6 +190,13 @@ export function collectRootDistBundledRuntimeMirrors(params) {
export function collectBundledPluginRootRuntimeMirrorErrors(params) {
const errors = [];
const declaredRootRuntimeDeps = collectRuntimeDependencySpecs(params.rootPackageJson);
const declaredMirrorDeps =
params.rootPackageJson?.openclaw?.bundle?.mirroredRootRuntimeDependencies ?? [];
const declaredMirrorDepNames = new Set(
Array.isArray(declaredMirrorDeps)
? declaredMirrorDeps.filter((dependencyName) => typeof dependencyName === "string")
: [],
);
for (const [dependencyName, record] of params.bundledRuntimeDependencySpecs) {
for (const conflict of record.conflicts) {
@@ -201,6 +208,14 @@ export function collectBundledPluginRootRuntimeMirrorErrors(params) {
for (const [dependencyName, record] of params.requiredRootMirrors) {
if (declaredRootRuntimeDeps.has(dependencyName)) {
if (!declaredMirrorDepNames.has(dependencyName)) {
const importerList = Array.from(record.importers)
.toSorted((left, right) => left.localeCompare(right))
.join(", ");
errors.push(
`installed package root mirror '${dependencyName}' for dist importers: ${importerList} is missing from package.json openclaw.bundle.mirroredRootRuntimeDependencies. Add it there so packaged runtime installs the mirrored dependency, or keep imports under dist/extensions/${record.pluginIds[0]}/.`,
);
}
continue;
}
const importerList = Array.from(record.importers)