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

推荐订阅源

博客园_首页
J
Java Code Geeks
博客园 - 聂微东
量子位
C
Check Point Blog
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
B
Blog
罗磊的独立博客
腾讯CDC
GbyAI
GbyAI
博客园 - 【当耐特】
A
About on SuperTechFans
M
MIT News - Artificial intelligence
U
Unit 42
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队

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: skip npm uninstall when managed root is absent · ope...
steipete · 2026-05-07 · via Recent Commits to openclaw:main

@@ -934,6 +934,20 @@ describe("uninstallPlugin", () => {

934934

const hoistedDir = path.join(npmRoot, "node_modules", "is-number");

935935

await fs.mkdir(pluginDir, { recursive: true });

936936

await fs.mkdir(hoistedDir, { recursive: true });

937+

await fs.writeFile(

938+

path.join(npmRoot, "package.json"),

939+

`${JSON.stringify(

940+

{

941+

private: true,

942+

dependencies: {

943+

"@openclaw/kitchen-sink": "1.0.0",

944+

"is-number": "7.0.0",

945+

},

946+

},

947+

null,

948+

2,

949+

)}\n`,

950+

);

937951

await fs.writeFile(path.join(pluginDir, "package.json"), "{}");

938952

await fs.writeFile(path.join(hoistedDir, "package.json"), "{}");

939953

@@ -1003,6 +1017,20 @@ describe("uninstallPlugin", () => {

10031017

const peerLink = path.join(peerPluginDir, "node_modules", "openclaw");

10041018

await fs.mkdir(removedPluginDir, { recursive: true });

10051019

await fs.mkdir(path.dirname(peerLink), { recursive: true });

1020+

await fs.writeFile(

1021+

path.join(npmRoot, "package.json"),

1022+

`${JSON.stringify(

1023+

{

1024+

private: true,

1025+

dependencies: {

1026+

"removed-plugin": "1.0.0",

1027+

"peer-plugin": "1.0.0",

1028+

},

1029+

},

1030+

null,

1031+

2,

1032+

)}\n`,

1033+

);

10061034

await fs.writeFile(path.join(removedPluginDir, "package.json"), "{}\n");

10071035

await fs.writeFile(

10081036

path.join(peerPluginDir, "package.json"),

@@ -1054,6 +1082,20 @@ describe("uninstallPlugin", () => {

10541082

const peerPluginDir = path.join(npmRoot, "node_modules", "peer-plugin");

10551083

const peerLink = path.join(peerPluginDir, "node_modules", "openclaw");

10561084

await fs.mkdir(peerLink, { recursive: true });

1085+

await fs.writeFile(

1086+

path.join(npmRoot, "package.json"),

1087+

`${JSON.stringify(

1088+

{

1089+

private: true,

1090+

dependencies: {

1091+

"missing-plugin": "1.0.0",

1092+

"peer-plugin": "1.0.0",

1093+

},

1094+

},

1095+

null,

1096+

2,

1097+

)}\n`,

1098+

);

10571099

await fs.writeFile(

10581100

path.join(peerPluginDir, "package.json"),

10591101

`${JSON.stringify(

@@ -1103,6 +1145,33 @@ describe("uninstallPlugin", () => {

11031145

await expect(fs.lstat(peerLink).then((stat) => stat.isSymbolicLink())).resolves.toBe(true);

11041146

});

110511471148+

it("removes stale npm install config when the managed npm root is already absent", async () => {

1149+

const stateDir = path.join(tempDir, "state");

1150+

const extensionsDir = path.join(stateDir, "extensions");

1151+

const npmRoot = path.join(stateDir, "npm");

1152+

const pluginDir = path.join(npmRoot, "node_modules", "missing-plugin");

1153+1154+

const result = await uninstallPlugin({

1155+

config: createPluginConfig({

1156+

entries: createSinglePluginEntries("missing-plugin"),

1157+

installs: {

1158+

"missing-plugin": createNpmInstallRecord("missing-plugin", pluginDir),

1159+

},

1160+

}),

1161+

pluginId: "missing-plugin",

1162+

deleteFiles: true,

1163+

extensionsDir,

1164+

});

1165+1166+

const successfulResult = expectSuccessfulUninstall(result);

1167+

expect(successfulResult.config.plugins).toBeUndefined();

1168+

expect(successfulResult.actions.entry).toBe(true);

1169+

expect(successfulResult.actions.install).toBe(true);

1170+

expect(successfulResult.actions.directory).toBe(false);

1171+

expect(successfulResult.warnings).toEqual([]);

1172+

expect(runCommandWithTimeoutMock).not.toHaveBeenCalled();

1173+

});

1174+11061175

it("warns and still removes npm package dirs when npm prune cleanup fails", async () => {

11071176

runCommandWithTimeoutMock.mockResolvedValueOnce({

11081177

code: 1,

@@ -1117,6 +1186,19 @@ describe("uninstallPlugin", () => {

11171186

const npmRoot = path.join(stateDir, "npm");

11181187

const pluginDir = path.join(npmRoot, "node_modules", "demo-plugin");

11191188

await fs.mkdir(pluginDir, { recursive: true });

1189+

await fs.writeFile(

1190+

path.join(npmRoot, "package.json"),

1191+

`${JSON.stringify(

1192+

{

1193+

private: true,

1194+

dependencies: {

1195+

"demo-plugin": "1.0.0",

1196+

},

1197+

},

1198+

null,

1199+

2,

1200+

)}\n`,

1201+

);

1120120211211203

const result = await uninstallPlugin({

11221204

config: createPluginConfig({