fix(memory): keep llama runtime optional (#71425)

* fix(memory): keep llama runtime optional

* fix(memory): harden optional llama runtime guard
This commit is contained in:
Vincent Koc
2026-04-25 00:09:12 -07:00
committed by GitHub
parent 4005a4f731
commit 9895ecead3
10 changed files with 69 additions and 746 deletions

View File

@@ -137,11 +137,6 @@
"class": "core-runtime",
"risk": ["parser", "markdown"]
},
"node-llama-cpp": {
"owner": "capability:memory-local-embeddings",
"class": "optional-peer-runtime",
"risk": ["native", "local-model-runtime", "large-transitive-cone"]
},
"openai": {
"owner": "provider:openai",
"class": "default-runtime-initially",

View File

@@ -22,6 +22,8 @@ type PackageJson = {
license?: string;
repository?: { url?: string } | string;
bin?: Record<string, string>;
dependencies?: Record<string, string>;
optionalDependencies?: Record<string, string>;
peerDependencies?: Record<string, string>;
peerDependenciesMeta?: Record<string, { optional?: boolean }>;
};
@@ -58,6 +60,7 @@ export type NpmDistTagMirrorAuth = {
source: "node-auth-token" | "npm-token" | "none";
};
const EXPECTED_REPOSITORY_URL = "https://github.com/openclaw/openclaw";
const OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE = "node-llama-cpp";
const MAX_CALVER_DISTANCE_DAYS = 2;
const REQUIRED_PACKED_PATHS = [
PACKAGE_DIST_INVENTORY_RELATIVE_PATH,
@@ -266,15 +269,25 @@ export function collectReleasePackageMetadataErrors(pkg: PackageJson): string[]
`package.json bin.openclaw must be "openclaw.mjs"; found "${pkg.bin?.openclaw ?? ""}".`,
);
}
if (pkg.peerDependencies?.["node-llama-cpp"] !== "3.18.1") {
if (pkg.dependencies?.[OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE]) {
errors.push(
`package.json peerDependencies["node-llama-cpp"] must be "3.18.1"; found "${
pkg.peerDependencies?.["node-llama-cpp"] ?? ""
}".`,
`package.json dependencies["${OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE}"] must be omitted; keep it optional.`,
);
}
if (pkg.peerDependenciesMeta?.["node-llama-cpp"]?.optional !== true) {
errors.push('package.json peerDependenciesMeta["node-llama-cpp"].optional must be true.');
if (pkg.optionalDependencies?.[OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE]) {
errors.push(
`package.json optionalDependencies["${OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE}"] must be omitted; keep it operator-installed.`,
);
}
if (pkg.peerDependencies?.[OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE]) {
errors.push(
`package.json peerDependencies["${OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE}"] must be omitted; keep it optional.`,
);
}
if (pkg.peerDependenciesMeta?.[OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE]) {
errors.push(
`package.json peerDependenciesMeta["${OPTIONAL_LOCAL_EMBEDDING_RUNTIME_PACKAGE}"] must be omitted; keep it optional.`,
);
}
return errors;