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

推荐订阅源

The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
The Cloudflare Blog
宝玉的分享
宝玉的分享
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog

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: align plugin install tests with ledger store · openc...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -25,6 +25,7 @@ import {

2525

runtimeErrors,

2626

runtimeLogs,

2727

writeConfigFile,

28+

writePersistedPluginInstallLedger,

2829

} from "./plugins-cli-test-helpers.js";

29303031

const CLI_STATE_ROOT = "/tmp/openclaw-state";

@@ -53,22 +54,6 @@ function createEmptyPluginConfig(): OpenClawConfig {

5354

} as OpenClawConfig;

5455

}

555656-

function createClawHubInstalledConfig(params: {

57-

pluginId: string;

58-

install: Record<string, unknown>;

59-

}): OpenClawConfig {

60-

const enabledCfg = createEnabledPluginConfig(params.pluginId);

61-

return {

62-

...enabledCfg,

63-

plugins: {

64-

...enabledCfg.plugins,

65-

installs: {

66-

[params.pluginId]: params.install,

67-

},

68-

},

69-

} as OpenClawConfig;

70-

}

71-7257

function createClawHubInstallResult(params: {

7358

pluginId: string;

7459

packageName: string;

@@ -320,19 +305,6 @@ describe("plugins cli install", () => {

320305

},

321306

},

322307

} as OpenClawConfig;

323-

const installedCfg = {

324-

...enabledCfg,

325-

plugins: {

326-

...enabledCfg.plugins,

327-

installs: {

328-

alpha: {

329-

source: "marketplace",

330-

installPath: cliInstallPath("alpha"),

331-

},

332-

},

333-

},

334-

} as OpenClawConfig;

335-336308

loadConfig.mockReturnValue(cfg);

337309

installPluginFromMarketplace.mockResolvedValue({

338310

ok: true,

@@ -345,20 +317,25 @@ describe("plugins cli install", () => {

345317

marketplacePlugin: "alpha",

346318

});

347319

enablePluginInConfig.mockReturnValue({ config: enabledCfg });

348-

recordPluginInstall.mockReturnValue(installedCfg);

349320

buildPluginDiagnosticsReport.mockReturnValue({

350321

plugins: [{ id: "alpha", kind: "provider" }],

351322

diagnostics: [],

352323

});

353324

applyExclusiveSlotSelection.mockReturnValue({

354-

config: installedCfg,

325+

config: enabledCfg,

355326

warnings: ["slot adjusted"],

356327

});

357328358329

await runPluginsCommand(["plugins", "install", "alpha", "--marketplace", "local/repo"]);

359330360331

expect(clearPluginManifestRegistryCache).toHaveBeenCalledTimes(1);

361-

expect(writeConfigFile).toHaveBeenCalledWith(installedCfg);

332+

expect(writePersistedPluginInstallLedger).toHaveBeenCalledWith({

333+

alpha: expect.objectContaining({

334+

source: "marketplace",

335+

installPath: cliInstallPath("alpha"),

336+

}),

337+

});

338+

expect(writeConfigFile).toHaveBeenCalledWith(enabledCfg);

362339

expect(runtimeLogs.some((line) => line.includes("slot adjusted"))).toBe(true);

363340

expect(runtimeLogs.some((line) => line.includes("Installed plugin: alpha"))).toBe(true);

364341

});

@@ -384,18 +361,6 @@ describe("plugins cli install", () => {

384361

},

385362

} as OpenClawConfig;

386363

const enabledCfg = createEnabledPluginConfig("demo");

387-

const installedCfg = createClawHubInstalledConfig({

388-

pluginId: "demo",

389-

install: {

390-

source: "clawhub",

391-

spec: "clawhub:demo@1.2.3",

392-

installPath: cliInstallPath("demo"),

393-

clawhubPackage: "demo",

394-

clawhubFamily: "code-plugin",

395-

clawhubChannel: "official",

396-

},

397-

});

398-399364

loadConfig.mockReturnValue(cfg);

400365

parseClawHubPluginSpec.mockReturnValue({ name: "demo" });

401366

installPluginFromClawHub.mockResolvedValue(

@@ -407,9 +372,8 @@ describe("plugins cli install", () => {

407372

}),

408373

);

409374

enablePluginInConfig.mockReturnValue({ config: enabledCfg });

410-

recordPluginInstall.mockReturnValue(installedCfg);

411375

applyExclusiveSlotSelection.mockReturnValue({

412-

config: installedCfg,

376+

config: enabledCfg,

413377

warnings: [],

414378

});

415379

@@ -420,18 +384,16 @@ describe("plugins cli install", () => {

420384

spec: "clawhub:demo",

421385

}),

422386

);

423-

expect(recordPluginInstall).toHaveBeenCalledWith(

424-

enabledCfg,

425-

expect.objectContaining({

426-

pluginId: "demo",

387+

expect(writePersistedPluginInstallLedger).toHaveBeenCalledWith({

388+

demo: expect.objectContaining({

427389

source: "clawhub",

428390

spec: "clawhub:demo@1.2.3",

429391

clawhubPackage: "demo",

430392

clawhubFamily: "code-plugin",

431393

clawhubChannel: "official",

432394

}),

433-

);

434-

expect(writeConfigFile).toHaveBeenCalledWith(installedCfg);

395+

});

396+

expect(writeConfigFile).toHaveBeenCalledWith(enabledCfg);

435397

expect(runtimeLogs.some((line) => line.includes("Installed plugin: demo"))).toBe(true);

436398

expect(installPluginFromNpmSpec).not.toHaveBeenCalled();

437399

});

@@ -478,16 +440,6 @@ describe("plugins cli install", () => {

478440

},

479441

} as OpenClawConfig;

480442

const enabledCfg = createEnabledPluginConfig("demo");

481-

const installedCfg = createClawHubInstalledConfig({

482-

pluginId: "demo",

483-

install: {

484-

source: "clawhub",

485-

spec: "clawhub:demo@1.2.3",

486-

installPath: cliInstallPath("demo"),

487-

clawhubPackage: "demo",

488-

},

489-

});

490-491443

loadConfig.mockReturnValue(cfg);

492444

installPluginFromClawHub.mockResolvedValue(

493445

createClawHubInstallResult({

@@ -498,9 +450,8 @@ describe("plugins cli install", () => {

498450

}),

499451

);

500452

enablePluginInConfig.mockReturnValue({ config: enabledCfg });

501-

recordPluginInstall.mockReturnValue(installedCfg);

502453

applyExclusiveSlotSelection.mockReturnValue({

503-

config: installedCfg,

454+

config: enabledCfg,

504455

warnings: [],

505456

});

506457

@@ -512,7 +463,14 @@ describe("plugins cli install", () => {

512463

}),

513464

);

514465

expect(installPluginFromNpmSpec).not.toHaveBeenCalled();

515-

expect(writeConfigFile).toHaveBeenCalledWith(installedCfg);

466+

expect(writePersistedPluginInstallLedger).toHaveBeenCalledWith({

467+

demo: expect.objectContaining({

468+

source: "clawhub",

469+

spec: "clawhub:demo@1.2.3",

470+

clawhubPackage: "demo",

471+

}),

472+

});

473+

expect(writeConfigFile).toHaveBeenCalledWith(enabledCfg);

516474

});

517475518476

it("falls back to npm when ClawHub does not have the package", async () => {