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

推荐订阅源

WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
B
Blog
F
Fortinet All Blogs
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
A
About on SuperTechFans
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
B
Blog RSS Feed

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(matrix): pass loaded cfg to verify CLI subcommands (#...
luyao618 · 2026-04-25 · via Recent Commits to openclaw:main

@@ -211,7 +211,9 @@ describe("matrix CLI verification commands", () => {

211211

});

212212

const program = buildProgram();

213213214-

await program.parseAsync(["matrix", "verify", "bootstrap", "--json"], { from: "user" });

214+

await program.parseAsync(["matrix", "verify", "bootstrap", "--json"], {

215+

from: "user",

216+

});

215217216218

expect(process.exitCode).toBe(1);

217219

});

@@ -267,6 +269,76 @@ describe("matrix CLI verification commands", () => {

267269

expect(process.exitCode).toBe(1);

268270

});

269271272+

it("passes loaded cfg to verify status action", async () => {

273+

const fakeCfg = { channels: { matrix: {} } };

274+

matrixRuntimeLoadConfigMock.mockReturnValue(fakeCfg);

275+

mockMatrixVerificationStatus({ recoveryKeyCreatedAt: null });

276+

const program = buildProgram();

277+278+

await program.parseAsync(["matrix", "verify", "status"], { from: "user" });

279+280+

expect(getMatrixVerificationStatusMock).toHaveBeenCalledWith(

281+

expect.objectContaining({ cfg: fakeCfg }),

282+

);

283+

});

284+285+

it("passes loaded cfg to all verify subcommands", async () => {

286+

const fakeCfg = { channels: { matrix: {} } };

287+

matrixRuntimeLoadConfigMock.mockReturnValue(fakeCfg);

288+289+

// verify bootstrap

290+

const program1 = buildProgram();

291+

await program1.parseAsync(["matrix", "verify", "bootstrap"], {

292+

from: "user",

293+

});

294+

expect(bootstrapMatrixVerificationMock).toHaveBeenCalledWith(

295+

expect.objectContaining({ cfg: fakeCfg }),

296+

);

297+298+

// verify device

299+

verifyMatrixRecoveryKeyMock.mockResolvedValue({ success: true });

300+

const program2 = buildProgram();

301+

await program2.parseAsync(["matrix", "verify", "device", "test-key"], {

302+

from: "user",

303+

});

304+

expect(verifyMatrixRecoveryKeyMock).toHaveBeenCalledWith(

305+

"test-key",

306+

expect.objectContaining({ cfg: fakeCfg }),

307+

);

308+309+

// verify backup status

310+

getMatrixRoomKeyBackupStatusMock.mockResolvedValue({});

311+

const program3 = buildProgram();

312+

await program3.parseAsync(["matrix", "verify", "backup", "status"], {

313+

from: "user",

314+

});

315+

expect(getMatrixRoomKeyBackupStatusMock).toHaveBeenCalledWith(

316+

expect.objectContaining({ cfg: fakeCfg }),

317+

);

318+319+

// verify backup reset

320+

const program4 = buildProgram();

321+

await program4.parseAsync(["matrix", "verify", "backup", "reset", "--yes"], { from: "user" });

322+

expect(resetMatrixRoomKeyBackupMock).toHaveBeenCalledWith(

323+

expect.objectContaining({ cfg: fakeCfg }),

324+

);

325+326+

// verify backup restore

327+

restoreMatrixRoomKeyBackupMock.mockResolvedValue({

328+

success: true,

329+

imported: 0,

330+

total: 0,

331+

backup: {},

332+

});

333+

const program5 = buildProgram();

334+

await program5.parseAsync(["matrix", "verify", "backup", "restore"], {

335+

from: "user",

336+

});

337+

expect(restoreMatrixRoomKeyBackupMock).toHaveBeenCalledWith(

338+

expect.objectContaining({ cfg: fakeCfg }),

339+

);

340+

});

341+270342

it("lists matrix devices", async () => {

271343

listMatrixOwnDevicesMock.mockResolvedValue([

272344

{

@@ -332,7 +404,9 @@ describe("matrix CLI verification commands", () => {

332404

from: "user",

333405

});

334406335-

expect(pruneMatrixStaleGatewayDevicesMock).toHaveBeenCalledWith({ accountId: "poe" });

407+

expect(pruneMatrixStaleGatewayDevicesMock).toHaveBeenCalledWith({

408+

accountId: "poe",

409+

});

336410

expect(console.log).toHaveBeenCalledWith("Deleted stale OpenClaw devices: BritdXC6iL");

337411

expect(console.log).toHaveBeenCalledWith("Current device: A7hWrQ70ea");

338412

expect(console.log).toHaveBeenCalledWith("Remaining devices: 1");

@@ -452,7 +526,9 @@ describe("matrix CLI verification commands", () => {

452526

{ from: "user" },

453527

);

454528455-

expect(bootstrapMatrixVerificationMock).toHaveBeenCalledWith({ accountId: "ops" });

529+

expect(bootstrapMatrixVerificationMock).toHaveBeenCalledWith({

530+

accountId: "ops",

531+

});

456532

expect(console.log).toHaveBeenCalledWith("Matrix verification bootstrap: complete");

457533

expect(console.log).toHaveBeenCalledWith(

458534

`Recovery key created at: ${formatExpectedLocalTimestamp("2026-03-09T06:00:00.000Z")}`,

@@ -705,7 +781,9 @@ describe("matrix CLI verification commands", () => {

705781

});

706782

const program = buildProgram();

707783708-

await program.parseAsync(["matrix", "verify", "bootstrap", "--json"], { from: "user" });

784+

await program.parseAsync(["matrix", "verify", "bootstrap", "--json"], {

785+

from: "user",

786+

});

709787710788

expect(process.exitCode).toBe(0);

711789

});

@@ -715,7 +793,9 @@ describe("matrix CLI verification commands", () => {

715793

mockMatrixVerificationStatus({ recoveryKeyCreatedAt: recoveryCreatedAt });

716794

const program = buildProgram();

717795718-

await program.parseAsync(["matrix", "verify", "status", "--verbose"], { from: "user" });

796+

await program.parseAsync(["matrix", "verify", "status", "--verbose"], {

797+

from: "user",

798+

});

719799720800

expect(console.log).toHaveBeenCalledWith(

721801

`Recovery key created at: ${formatExpectedLocalTimestamp(recoveryCreatedAt)}`,

@@ -920,7 +1000,9 @@ describe("matrix CLI verification commands", () => {

9201000

it("requires --yes before resetting the Matrix room-key backup", async () => {

9211001

const program = buildProgram();

9221002923-

await program.parseAsync(["matrix", "verify", "backup", "reset"], { from: "user" });

1003+

await program.parseAsync(["matrix", "verify", "backup", "reset"], {

1004+

from: "user",

1005+

});

92410069251007

expect(process.exitCode).toBe(1);

9261008

expect(resetMatrixRoomKeyBackupMock).not.toHaveBeenCalled();

@@ -936,7 +1018,10 @@ describe("matrix CLI verification commands", () => {

9361018

from: "user",

9371019

});

9381020939-

expect(resetMatrixRoomKeyBackupMock).toHaveBeenCalledWith({ accountId: "default" });

1021+

expect(resetMatrixRoomKeyBackupMock).toHaveBeenCalledWith({

1022+

accountId: "default",

1023+

cfg: {},

1024+

});

9401025

expect(console.log).toHaveBeenCalledWith("Reset success: yes");

9411026

expect(console.log).toHaveBeenCalledWith("Previous backup version: 1");

9421027

expect(console.log).toHaveBeenCalledWith("Deleted backup version: 1");

@@ -981,6 +1066,7 @@ describe("matrix CLI verification commands", () => {

98110669821067

expect(getMatrixVerificationStatusMock).toHaveBeenCalledWith({

9831068

accountId: "assistant",

1069+

cfg: {},

9841070

includeRecoveryKey: false,

9851071

});

9861072

expect(console.log).toHaveBeenCalledWith("Account: assistant");