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

推荐订阅源

Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Vercel News
Vercel News
Martin Fowler
Martin Fowler
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LangChain Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs

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(plugins): prune managed peers on uninstall · openclaw...
vincentkoc · 2026-05-13 · via Recent Commits to openclaw:main

@@ -1085,6 +1085,107 @@ describe("uninstallPlugin", () => {

10851085

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

10861086

});

108710871088+

it("prunes managed peer dependencies after their owning npm plugin is uninstalled", async () => {

1089+

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

1090+

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

1091+

const removedPluginDir = path.join(npmRoot, "node_modules", "removed-plugin");

1092+

const runtimePeerDir = path.join(npmRoot, "node_modules", "runtime-peer");

1093+

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

1094+

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

1095+

await fs.writeFile(

1096+

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

1097+

`${JSON.stringify(

1098+

{

1099+

private: true,

1100+

dependencies: {

1101+

"removed-plugin": "1.0.0",

1102+

"runtime-peer": "1.0.0",

1103+

},

1104+

openclaw: {

1105+

managedPeerDependencies: ["runtime-peer"],

1106+

},

1107+

},

1108+

null,

1109+

2,

1110+

)}\n`,

1111+

);

1112+

await fs.writeFile(

1113+

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

1114+

`${JSON.stringify(

1115+

{

1116+

name: "removed-plugin",

1117+

version: "1.0.0",

1118+

peerDependencies: { "runtime-peer": "^1.0.0" },

1119+

},

1120+

null,

1121+

2,

1122+

)}\n`,

1123+

);

1124+

await fs.writeFile(

1125+

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

1126+

`${JSON.stringify({ name: "runtime-peer", version: "1.0.0" }, null, 2)}\n`,

1127+

);

1128+

runCommandWithTimeoutMock.mockImplementation(async (argv: string[]) => {

1129+

if (argv[1] === "uninstall") {

1130+

expect(argv).toContain("--legacy-peer-deps");

1131+

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

1132+

const rootManifest = JSON.parse(

1133+

await fs.readFile(path.join(npmRoot, "package.json"), "utf8"),

1134+

) as { dependencies?: Record<string, string> };

1135+

delete rootManifest.dependencies?.["removed-plugin"];

1136+

await fs.writeFile(

1137+

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

1138+

`${JSON.stringify(rootManifest, null, 2)}\n`,

1139+

);

1140+

return {

1141+

code: 0,

1142+

stdout: "",

1143+

stderr: "",

1144+

signal: null,

1145+

killed: false,

1146+

termination: "exit",

1147+

};

1148+

}

1149+

if (argv[1] === "install") {

1150+

expect(argv).toContain("--legacy-peer-deps");

1151+

expect(argv).toContain("--omit=peer");

1152+

await fs.rm(runtimePeerDir, { recursive: true, force: true });

1153+

return {

1154+

code: 0,

1155+

stdout: "",

1156+

stderr: "",

1157+

signal: null,

1158+

killed: false,

1159+

termination: "exit",

1160+

};

1161+

}

1162+

throw new Error(`unexpected command: ${argv.join(" ")}`);

1163+

});

1164+1165+

const applied = await applyPluginUninstallDirectoryRemoval({

1166+

target: removedPluginDir,

1167+

cleanup: {

1168+

kind: "npm",

1169+

npmRoot,

1170+

packageName: "removed-plugin",

1171+

},

1172+

});

1173+1174+

expect(applied).toEqual({ directoryRemoved: true, warnings: [] });

1175+

await expectPathAccessState(removedPluginDir, "missing");

1176+

await expectPathAccessState(runtimePeerDir, "missing");

1177+

const rootManifest = JSON.parse(

1178+

await fs.readFile(path.join(npmRoot, "package.json"), "utf8"),

1179+

) as {

1180+

dependencies?: Record<string, string>;

1181+

openclaw?: { managedPeerDependencies?: string[] };

1182+

};

1183+

expect(rootManifest.dependencies?.["removed-plugin"]).toBeUndefined();

1184+

expect(rootManifest.dependencies?.["runtime-peer"]).toBeUndefined();

1185+

expect(rootManifest.openclaw?.managedPeerDependencies ?? []).not.toContain("runtime-peer");

1186+

expect(runCommandWithTimeoutMock).toHaveBeenCalledTimes(2);

1187+

});

1188+10881189

it("runs npm cleanup when the managed package directory is already absent", async () => {

10891190

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

10901191

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