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

推荐订阅源

Google DeepMind News
Google DeepMind News
博客园 - 聂微东
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
The GitHub Blog
The GitHub Blog
博客园_首页
博客园 - 叶小钗
腾讯CDC
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
宝玉的分享
宝玉的分享
D
Docker

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(e2e): reject corrupt plugin update false greens · ope...
vincentkoc · 2026-05-26 · via Recent Commits to openclaw:main

@@ -1,9 +1,49 @@

1-

import { readFileSync } from "node:fs";

1+

import { execFileSync, spawnSync } from "node:child_process";

2+

import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";

3+

import { tmpdir } from "node:os";

4+

import path from "node:path";

25

import { describe, expect, it } from "vitest";

3647

const PLUGIN_UPDATE_DOCKER_SCRIPT = "scripts/e2e/plugin-update-unchanged-docker.sh";

58

const PLUGIN_UPDATE_SCENARIO_SCRIPT = "scripts/e2e/lib/plugin-update/unchanged-scenario.sh";

69

const PLUGIN_UPDATE_PROBE_SCRIPT = "scripts/e2e/lib/plugin-update/probe.mjs";

10+

const CORRUPT_PLUGIN_ID = "demo-corrupt-plugin";

11+12+

function runProbe(command: string, payload: unknown): void {

13+

const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-update-probe-"));

14+

const payloadPath = path.join(root, "payload.json");

15+

try {

16+

writeFileSync(payloadPath, `${JSON.stringify(payload, null, 2)}\n`);

17+

execFileSync("node", [PLUGIN_UPDATE_PROBE_SCRIPT, command, payloadPath, CORRUPT_PLUGIN_ID], {

18+

encoding: "utf8",

19+

stdio: "pipe",

20+

});

21+

} finally {

22+

rmSync(root, { recursive: true, force: true });

23+

}

24+

}

25+26+

function runProbeStatus(

27+

command: string,

28+

payload: unknown,

29+

): { status: number | null; stderr: string } {

30+

const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-update-probe-"));

31+

const payloadPath = path.join(root, "payload.json");

32+

try {

33+

writeFileSync(payloadPath, `${JSON.stringify(payload, null, 2)}\n`);

34+

const result = spawnSync(

35+

"node",

36+

[PLUGIN_UPDATE_PROBE_SCRIPT, command, payloadPath, CORRUPT_PLUGIN_ID],

37+

{

38+

encoding: "utf8",

39+

stdio: "pipe",

40+

},

41+

);

42+

return { status: result.status, stderr: result.stderr };

43+

} finally {

44+

rmSync(root, { recursive: true, force: true });

45+

}

46+

}

747848

describe("plugin update unchanged Docker E2E", () => {

949

it("seeds current plugin install ledger state before checking config stability", () => {

@@ -31,4 +71,41 @@ describe("plugin update unchanged Docker E2E", () => {

3171

expect(script).toContain('"--- plugin update output ---"');

3272

expect(script).toContain('"--- local registry output ---"');

3373

});

74+75+

it("requires disabled-after-failure corrupt plugin updates to stay warnings", () => {

76+

const disabledAfterFailure = {

77+

status: "ok",

78+

npm: {

79+

outcomes: [

80+

{

81+

pluginId: CORRUPT_PLUGIN_ID,

82+

status: "skipped",

83+

message:

84+

`Disabled "${CORRUPT_PLUGIN_ID}" after plugin update failure; OpenClaw will continue without it. Failed to update ${CORRUPT_PLUGIN_ID}: registry timeout`,

85+

},

86+

],

87+

},

88+

};

89+90+

const acceptedOkResult = runProbeStatus("assert-corrupt-plugin-result", disabledAfterFailure);

91+92+

expect(acceptedOkResult.status).not.toBe(0);

93+

expect(acceptedOkResult.stderr).toContain("expected clean or repaired corrupt plugin state");

94+

expect(() =>

95+

runProbe("assert-corrupt-plugin-result", {

96+

...disabledAfterFailure,

97+

status: "warning",

98+

warnings: [

99+

{

100+

pluginId: CORRUPT_PLUGIN_ID,

101+

message:

102+

`Plugin "${CORRUPT_PLUGIN_ID}" could not be processed after the core update: ` +

103+

disabledAfterFailure.npm.outcomes[0].message +

104+

" Run openclaw doctor --fix to attempt automatic repair. " +

105+

`Run openclaw plugins inspect ${CORRUPT_PLUGIN_ID} --runtime --json for details.`,

106+

},

107+

],

108+

}),

109+

).not.toThrow();

110+

});

34111

});