惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
D
DataBreaches.Net
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Fortinet All Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
Recent Announcements
Recent Announcements
Jina AI
Jina AI
G
Google Developers Blog
腾讯CDC
博客园_首页
博客园 - 【当耐特】

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: avoid full runtime dependency restaging · openclaw/o...
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -1757,16 +1757,33 @@ function shouldCleanBundledRuntimeDepsInstallExecutionRoot(params: {

17571757

return installExecutionRoot.startsWith(`${installRoot}${path.sep}`);

17581758

}

175917591760-

function ensureNpmInstallExecutionManifest(installExecutionRoot: string): void {

1760+

function createNpmInstallExecutionManifest(installSpecs: readonly string[]): JsonObject {

1761+

const dependencies: Record<string, string> = {};

1762+

for (const spec of installSpecs) {

1763+

const dep = parseInstallableRuntimeDepSpec(spec);

1764+

dependencies[dep.name] = dep.version;

1765+

}

1766+

const sortedDependencies = Object.fromEntries(

1767+

Object.entries(dependencies).toSorted(([left], [right]) => left.localeCompare(right)),

1768+

);

1769+

return {

1770+

name: "openclaw-runtime-deps-install",

1771+

private: true,

1772+

...(Object.keys(sortedDependencies).length > 0 ? { dependencies: sortedDependencies } : {}),

1773+

};

1774+

}

1775+1776+

function ensureNpmInstallExecutionManifest(

1777+

installExecutionRoot: string,

1778+

installSpecs: readonly string[] = [],

1779+

): void {

17611780

const manifestPath = path.join(installExecutionRoot, "package.json");

1762-

if (fs.existsSync(manifestPath)) {

1781+

const manifest = createNpmInstallExecutionManifest(installSpecs);

1782+

const nextContents = `${JSON.stringify(manifest, null, 2)}\n`;

1783+

if (fs.existsSync(manifestPath) && fs.readFileSync(manifestPath, "utf8") === nextContents) {

17631784

return;

17641785

}

1765-

fs.writeFileSync(

1766-

manifestPath,

1767-

`${JSON.stringify({ name: "openclaw-runtime-deps-install", private: true }, null, 2)}\n`,

1768-

"utf8",

1769-

);

1786+

fs.writeFileSync(manifestPath, nextContents, "utf8");

17701787

}

1771178817721789

function formatBundledRuntimeDepsInstallError(result: {

@@ -1885,6 +1902,7 @@ export function installBundledRuntimeDeps(params: {

18851902

installExecutionRoot?: string;

18861903

linkNodeModulesFromExecutionRoot?: boolean;

18871904

missingSpecs: string[];

1905+

installSpecs?: string[];

18881906

env: NodeJS.ProcessEnv;

18891907

warn?: (message: string) => void;

18901908

}): void {

@@ -1911,7 +1929,15 @@ export function installBundledRuntimeDeps(params: {

19111929

// doctor repair path installs directly in the external stage dir; without a

19121930

// manifest, npm can honor a user's global prefix config and write under

19131931

// $HOME/node_modules instead of our managed stage.

1914-

ensureNpmInstallExecutionManifest(installExecutionRoot);

1932+

//

1933+

// The manifest also declares retained staged deps. npm may prune packages

1934+

// that are present in node_modules but absent from package dependencies

1935+

// while installing a new explicit spec, so keep retained deps in the

1936+

// manifest and pass only actually missing specs as install args.

1937+

ensureNpmInstallExecutionManifest(

1938+

installExecutionRoot,

1939+

params.installSpecs ?? params.missingSpecs,

1940+

);

19151941

const installEnv = createBundledRuntimeDepsInstallEnv(params.env, {

19161942

cacheDir: path.join(installExecutionRoot, ".openclaw-npm-cache"),

19171943

});

@@ -1955,6 +1981,7 @@ export async function installBundledRuntimeDepsAsync(params: {

19551981

installExecutionRoot?: string;

19561982

linkNodeModulesFromExecutionRoot?: boolean;

19571983

missingSpecs: string[];

1984+

installSpecs?: string[];

19581985

env: NodeJS.ProcessEnv;

19591986

warn?: (message: string) => void;

19601987

onProgress?: (message: string) => void;

@@ -1978,7 +2005,10 @@ export async function installBundledRuntimeDepsAsync(params: {

19782005

if (diskWarning) {

19792006

params.warn?.(diskWarning);

19802007

}

1981-

ensureNpmInstallExecutionManifest(installExecutionRoot);

2008+

ensureNpmInstallExecutionManifest(

2009+

installExecutionRoot,

2010+

params.installSpecs ?? params.missingSpecs,

2011+

);

19822012

const installEnv = createBundledRuntimeDepsInstallEnv(params.env, {

19832013

cacheDir: path.join(installExecutionRoot, ".openclaw-npm-cache"),

19842014

});

@@ -2035,7 +2065,8 @@ export function repairBundledRuntimeDepsInstallRoot(params: {

20352065

((installParams) =>

20362066

installBundledRuntimeDeps({

20372067

installRoot: installParams.installRoot,

2038-

missingSpecs: installParams.installSpecs ?? installParams.missingSpecs,

2068+

missingSpecs: installParams.missingSpecs,

2069+

installSpecs: installParams.installSpecs,

20392070

env: params.env,

20402071

warn: params.warn,

20412072

}));

@@ -2129,7 +2160,8 @@ export async function repairBundledRuntimeDepsInstallRootAsync(params: {

21292160

((installParams) =>

21302161

installBundledRuntimeDepsAsync({

21312162

installRoot: installParams.installRoot,

2132-

missingSpecs: installParams.installSpecs ?? installParams.missingSpecs,

2163+

missingSpecs: installParams.missingSpecs,

2164+

installSpecs: installParams.installSpecs,

21332165

env: params.env,

21342166

warn: params.warn,

21352167

onProgress: params.onProgress,

@@ -2268,14 +2300,22 @@ export function ensureBundledPluginRuntimeDeps(params: {

2268230022692301

const install =

22702302

params.installDeps ??

2271-

((installParams) =>

2272-

installBundledRuntimeDeps({

2303+

((installParams) => {

2304+

const isolatedExecutionRoot =

2305+

installParams.installExecutionRoot &&

2306+

path.resolve(installParams.installExecutionRoot) !==

2307+

path.resolve(installParams.installRoot);

2308+

return installBundledRuntimeDeps({

22732309

installRoot: installParams.installRoot,

22742310

installExecutionRoot: installParams.installExecutionRoot,

22752311

linkNodeModulesFromExecutionRoot: installParams.linkNodeModulesFromExecutionRoot,

2276-

missingSpecs: installParams.installSpecs ?? installParams.missingSpecs,

2312+

missingSpecs: isolatedExecutionRoot

2313+

? (installParams.installSpecs ?? installParams.missingSpecs)

2314+

: installParams.missingSpecs,

2315+

installSpecs: installParams.installSpecs,

22772316

env: params.env,

2278-

}));

2317+

});

2318+

});

22792319

const finishActivity = beginBundledRuntimeDepsInstall({

22802320

installRoot,

22812321

missingSpecs,