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

推荐订阅源

月光博客
月光博客
D
Docker
腾讯CDC
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
博客园 - 三生石上(FineUI控件)
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
IT之家
IT之家
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
爱范儿
爱范儿
Microsoft Azure Blog
Microsoft Azure Blog
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
博客园 - 【当耐特】

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: fail closed on plugin integrity drift · openclaw/ope...
steipete · 2026-04-22 · via Recent Commits to openclaw:main

@@ -545,6 +545,109 @@ describe("update-cli", () => {

545545

expect(spawn).not.toHaveBeenCalled();

546546

});

547547548+

it("uses a fail-closed integrity policy for post-core plugin updates", async () => {

549+

await withEnvAsync(

550+

{

551+

OPENCLAW_UPDATE_POST_CORE: "1",

552+

OPENCLAW_UPDATE_POST_CORE_CHANNEL: "stable",

553+

},

554+

async () => {

555+

await updateCommand({ restart: false });

556+

},

557+

);

558+559+

const updateCall = updateNpmInstalledPlugins.mock.calls[0]?.[0] as

560+

| {

561+

onIntegrityDrift?: (drift: {

562+

pluginId: string;

563+

spec: string;

564+

expectedIntegrity: string;

565+

actualIntegrity: string;

566+

resolvedSpec?: string;

567+

}) => Promise<boolean>;

568+

}

569+

| undefined;

570+

const onIntegrityDrift = updateCall?.onIntegrityDrift;

571+

expect(onIntegrityDrift).toBeTypeOf("function");

572+

if (!onIntegrityDrift) {

573+

throw new Error("missing integrity drift handler");

574+

}

575+576+

vi.mocked(runtimeCapture.log).mockClear();

577+

await expect(

578+

onIntegrityDrift({

579+

pluginId: "demo",

580+

spec: "@openclaw/demo@1.0.0",

581+

resolvedSpec: "@openclaw/demo@1.0.0",

582+

expectedIntegrity: "sha512-old",

583+

actualIntegrity: "sha512-new",

584+

}),

585+

).resolves.toBe(false);

586+

const logs = vi.mocked(runtimeCapture.log).mock.calls.map((call) => String(call[0]));

587+

expect(logs.join("\n")).toContain("Plugin update aborted");

588+

});

589+590+

it("includes plugin integrity drift details in update json output", async () => {

591+

updateNpmInstalledPlugins.mockImplementationOnce(

592+

async (params: {

593+

config: OpenClawConfig;

594+

onIntegrityDrift?: (drift: {

595+

pluginId: string;

596+

spec: string;

597+

resolvedSpec?: string;

598+

resolvedVersion?: string;

599+

expectedIntegrity: string;

600+

actualIntegrity: string;

601+

dryRun: boolean;

602+

}) => Promise<boolean>;

603+

}) => {

604+

const proceed = await params.onIntegrityDrift?.({

605+

pluginId: "demo",

606+

spec: "@openclaw/demo@1.0.0",

607+

resolvedSpec: "@openclaw/demo@1.0.0",

608+

resolvedVersion: "1.0.0",

609+

expectedIntegrity: "sha512-old",

610+

actualIntegrity: "sha512-new",

611+

dryRun: false,

612+

});

613+

return {

614+

changed: false,

615+

config: params.config,

616+

outcomes: [

617+

{

618+

pluginId: "demo",

619+

status: "error",

620+

message:

621+

proceed === false

622+

? "Failed to update demo: aborted: npm package integrity drift detected for @openclaw/demo@1.0.0"

623+

: "unexpected drift continuation",

624+

},

625+

],

626+

};

627+

},

628+

);

629+

vi.mocked(defaultRuntime.writeJson).mockClear();

630+631+

await updateCommand({ json: true, restart: false });

632+633+

const jsonOutput = vi.mocked(defaultRuntime.writeJson).mock.calls.at(-1)?.[0] as

634+

| UpdateRunResult

635+

| undefined;

636+

expect(jsonOutput?.postUpdate?.plugins?.integrityDrifts).toEqual([

637+

{

638+

pluginId: "demo",

639+

spec: "@openclaw/demo@1.0.0",

640+

resolvedSpec: "@openclaw/demo@1.0.0",

641+

resolvedVersion: "1.0.0",

642+

expectedIntegrity: "sha512-old",

643+

actualIntegrity: "sha512-new",

644+

action: "aborted",

645+

},

646+

]);

647+

expect(jsonOutput?.postUpdate?.plugins?.status).toBe("error");

648+

expect(jsonOutput?.postUpdate?.plugins?.npm.outcomes[0]?.status).toBe("error");

649+

});

650+548651

it.each([

549652

{

550653

name: "preview mode",