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

推荐订阅源

Jina AI
Jina AI
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
J
Java Code Geeks
博客园 - 聂微东
B
Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
腾讯CDC
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
美团技术团队
博客园 - Franky
Google DeepMind News
Google DeepMind News
V
V2EX
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
The Cloudflare 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
test: clear cli status registration broad matchers · open...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -46,6 +46,27 @@ const flowsCancelCommand = mocks.flowsCancelCommand;

4646

const setVerbose = mocks.setVerbose;

4747

const runtime = mocks.runtime;

484849+

type MockCalls = {

50+

mock: { calls: unknown[][] };

51+

};

52+53+

function requireRecord(value: unknown, label: string): Record<string, unknown> {

54+

expect(typeof value, label).toBe("object");

55+

expect(value, label).not.toBeNull();

56+

return value as Record<string, unknown>;

57+

}

58+59+

function expectCommandOptions(command: MockCalls, expected: Record<string, unknown>) {

60+

expect(command.mock.calls).toHaveLength(1);

61+

const [options, actualRuntime] = command.mock.calls[0] ?? [];

62+

expect(actualRuntime).toBe(runtime);

63+

const optionsRecord = requireRecord(options, "command options");

64+

for (const [key, value] of Object.entries(expected)) {

65+

expect(optionsRecord[key], key).toEqual(value);

66+

}

67+

return optionsRecord;

68+

}

69+4970

vi.mock("../../commands/status.js", () => ({

5071

statusCommand: mocks.statusCommand,

5172

}));

@@ -135,17 +156,14 @@ describe("registerStatusHealthSessionsCommands", () => {

135156

]);

136157137158

expect(setVerbose).toHaveBeenCalledWith(true);

138-

expect(statusCommand).toHaveBeenCalledWith(

139-

expect.objectContaining({

140-

json: true,

141-

all: true,

142-

deep: true,

143-

usage: true,

144-

timeoutMs: 5000,

145-

verbose: true,

146-

}),

147-

runtime,

148-

);

159+

expectCommandOptions(statusCommand, {

160+

json: true,

161+

all: true,

162+

deep: true,

163+

usage: true,

164+

timeoutMs: 5000,

165+

verbose: true,

166+

});

149167

});

150168151169

it("rejects invalid status timeout without calling status command", async () => {

@@ -162,14 +180,11 @@ describe("registerStatusHealthSessionsCommands", () => {

162180

await runCli(["health", "--json", "--timeout", "2500", "--verbose"]);

163181164182

expect(setVerbose).toHaveBeenCalledWith(true);

165-

expect(healthCommand).toHaveBeenCalledWith(

166-

expect.objectContaining({

167-

json: true,

168-

timeoutMs: 2500,

169-

verbose: true,

170-

}),

171-

runtime,

172-

);

183+

expectCommandOptions(healthCommand, {

184+

json: true,

185+

timeoutMs: 2500,

186+

verbose: true,

187+

});

173188

});

174189175190

it("rejects invalid health timeout without calling health command", async () => {

@@ -196,38 +211,29 @@ describe("registerStatusHealthSessionsCommands", () => {

196211

]);

197212198213

expect(setVerbose).toHaveBeenCalledWith(true);

199-

expect(sessionsCommand).toHaveBeenCalledWith(

200-

expect.objectContaining({

201-

json: true,

202-

store: "/tmp/sessions.json",

203-

active: "120",

204-

limit: "25",

205-

}),

206-

runtime,

207-

);

214+

expectCommandOptions(sessionsCommand, {

215+

json: true,

216+

store: "/tmp/sessions.json",

217+

active: "120",

218+

limit: "25",

219+

});

208220

});

209221210222

it("runs sessions command with --agent forwarding", async () => {

211223

await runCli(["sessions", "--agent", "work"]);

212224213-

expect(sessionsCommand).toHaveBeenCalledWith(

214-

expect.objectContaining({

215-

agent: "work",

216-

allAgents: false,

217-

}),

218-

runtime,

219-

);

225+

expectCommandOptions(sessionsCommand, {

226+

agent: "work",

227+

allAgents: false,

228+

});

220229

});

221230222231

it("runs sessions command with --all-agents forwarding", async () => {

223232

await runCli(["sessions", "--all-agents"]);

224233225-

expect(sessionsCommand).toHaveBeenCalledWith(

226-

expect.objectContaining({

227-

allAgents: true,

228-

}),

229-

runtime,

230-

);

234+

expectCommandOptions(sessionsCommand, {

235+

allAgents: true,

236+

});

231237

});

232238233239

it("runs sessions cleanup subcommand with forwarded options", async () => {

@@ -245,31 +251,25 @@ describe("registerStatusHealthSessionsCommands", () => {

245251

"--json",

246252

]);

247253248-

expect(sessionsCleanupCommand).toHaveBeenCalledWith(

249-

expect.objectContaining({

250-

store: "/tmp/sessions.json",

251-

agent: undefined,

252-

allAgents: false,

253-

dryRun: true,

254-

enforce: true,

255-

fixMissing: true,

256-

fixDmScope: true,

257-

activeKey: "agent:main:main",

258-

json: true,

259-

}),

260-

runtime,

261-

);

254+

expectCommandOptions(sessionsCleanupCommand, {

255+

store: "/tmp/sessions.json",

256+

agent: undefined,

257+

allAgents: false,

258+

dryRun: true,

259+

enforce: true,

260+

fixMissing: true,

261+

fixDmScope: true,

262+

activeKey: "agent:main:main",

263+

json: true,

264+

});

262265

});

263266264267

it("forwards parent-level all-agents to cleanup subcommand", async () => {

265268

await runCli(["sessions", "--all-agents", "cleanup", "--dry-run"]);

266269267-

expect(sessionsCleanupCommand).toHaveBeenCalledWith(

268-

expect.objectContaining({

269-

allAgents: true,

270-

}),

271-

runtime,

272-

);

270+

expectCommandOptions(sessionsCleanupCommand, {

271+

allAgents: true,

272+

});

273273

});

274274275275

it("runs sessions export-trajectory with owner-routable export options", async () => {

@@ -287,16 +287,13 @@ describe("registerStatusHealthSessionsCommands", () => {

287287

"--json",

288288

]);

289289290-

expect(exportTrajectoryCommand).toHaveBeenCalledWith(

291-

expect.objectContaining({

292-

sessionKey: "agent:main:telegram:direct:owner",

293-

output: "bug-123",

294-

workspace: "/workspace",

295-

store: "/tmp/sessions.json",

296-

json: true,

297-

}),

298-

runtime,

299-

);

290+

expectCommandOptions(exportTrajectoryCommand, {

291+

sessionKey: "agent:main:telegram:direct:owner",

292+

output: "bug-123",

293+

workspace: "/workspace",

294+

store: "/tmp/sessions.json",

295+

json: true,

296+

});

300297

});

301298302299

it("forwards encoded sessions export-trajectory requests", async () => {

@@ -308,50 +305,38 @@ describe("registerStatusHealthSessionsCommands", () => {

308305

"--json",

309306

]);

310307311-

expect(exportTrajectoryCommand).toHaveBeenCalledWith(

312-

expect.objectContaining({

313-

requestJsonBase64: "eyJzZXNzaW9uS2V5IjoiYWdlbnQ6bWFpbjp0ZWxlZ3JhbTpkaXJlY3Q6b3duZXIifQ",

314-

json: true,

315-

}),

316-

runtime,

317-

);

308+

expectCommandOptions(exportTrajectoryCommand, {

309+

requestJsonBase64: "eyJzZXNzaW9uS2V5IjoiYWdlbnQ6bWFpbjp0ZWxlZ3JhbTpkaXJlY3Q6b3duZXIifQ",

310+

json: true,

311+

});

318312

});

319313320314

it("runs tasks list from the parent command", async () => {

321315

await runCli(["tasks", "--json", "--runtime", "acp", "--status", "running"]);

322316323-

expect(tasksListCommand).toHaveBeenCalledWith(

324-

expect.objectContaining({

325-

json: true,

326-

runtime: "acp",

327-

status: "running",

328-

}),

329-

runtime,

330-

);

317+

expectCommandOptions(tasksListCommand, {

318+

json: true,

319+

runtime: "acp",

320+

status: "running",

321+

});

331322

});

332323333324

it("runs tasks show subcommand with lookup forwarding", async () => {

334325

await runCli(["tasks", "show", "run-123", "--json"]);

335326336-

expect(tasksShowCommand).toHaveBeenCalledWith(

337-

expect.objectContaining({

338-

lookup: "run-123",

339-

json: true,

340-

}),

341-

runtime,

342-

);

327+

expectCommandOptions(tasksShowCommand, {

328+

lookup: "run-123",

329+

json: true,

330+

});

343331

});

344332345333

it("runs tasks maintenance subcommand with apply forwarding", async () => {

346334

await runCli(["tasks", "--json", "maintenance", "--apply"]);

347335348-

expect(tasksMaintenanceCommand).toHaveBeenCalledWith(

349-

expect.objectContaining({

350-

json: true,

351-

apply: true,

352-

}),

353-

runtime,

354-

);

336+

expectCommandOptions(tasksMaintenanceCommand, {

337+

json: true,

338+

apply: true,

339+

});

355340

});

356341357342

it("runs tasks audit subcommand with filters", async () => {

@@ -367,84 +352,63 @@ describe("registerStatusHealthSessionsCommands", () => {

367352

"5",

368353

]);

369354370-

expect(tasksAuditCommand).toHaveBeenCalledWith(

371-

expect.objectContaining({

372-

json: true,

373-

severity: "error",

374-

code: "stale_running",

375-

limit: 5,

376-

}),

377-

runtime,

378-

);

355+

expectCommandOptions(tasksAuditCommand, {

356+

json: true,

357+

severity: "error",

358+

code: "stale_running",

359+

limit: 5,

360+

});

379361

});

380362381363

it("routes tasks flow commands through the TaskFlow handlers", async () => {

382364

await runCli(["tasks", "flow", "list", "--json", "--status", "blocked"]);

383-

expect(flowsListCommand).toHaveBeenCalledWith(expect.any(Object), runtime);

365+

expectCommandOptions(flowsListCommand, {});

384366385367

await runCli(["tasks", "flow", "show", "flow-123", "--json"]);

386-

expect(flowsShowCommand).toHaveBeenCalledWith(

387-

expect.objectContaining({

388-

lookup: "flow-123",

389-

}),

390-

runtime,

391-

);

368+

expectCommandOptions(flowsShowCommand, {

369+

lookup: "flow-123",

370+

});

392371393372

await runCli(["tasks", "flow", "cancel", "flow-123"]);

394-

expect(flowsCancelCommand).toHaveBeenCalledWith(

395-

expect.objectContaining({

396-

lookup: "flow-123",

397-

}),

398-

runtime,

399-

);

373+

expectCommandOptions(flowsCancelCommand, {

374+

lookup: "flow-123",

375+

});

400376

});

401377402378

it("runs tasks notify subcommand with lookup and policy forwarding", async () => {

403379

await runCli(["tasks", "notify", "run-123", "state_changes"]);

404380405-

expect(tasksNotifyCommand).toHaveBeenCalledWith(

406-

expect.objectContaining({

407-

lookup: "run-123",

408-

notify: "state_changes",

409-

}),

410-

runtime,

411-

);

381+

expectCommandOptions(tasksNotifyCommand, {

382+

lookup: "run-123",

383+

notify: "state_changes",

384+

});

412385

});

413386414387

it("runs tasks cancel subcommand with lookup forwarding", async () => {

415388

await runCli(["tasks", "cancel", "run-123"]);

416389417-

expect(tasksCancelCommand).toHaveBeenCalledWith(

418-

expect.objectContaining({

419-

lookup: "run-123",

420-

}),

421-

runtime,

422-

);

390+

expectCommandOptions(tasksCancelCommand, {

391+

lookup: "run-123",

392+

});

423393

});

424394425395

it("runs commitments list with filters", async () => {

426396

await runCli(["commitments", "--json", "--agent", "work", "--status", "snoozed"]);

427397428-

expect(commitmentsListCommand).toHaveBeenCalledWith(

429-

expect.objectContaining({

430-

json: true,

431-

agent: "work",

432-

status: "snoozed",

433-

all: false,

434-

}),

435-

runtime,

436-

);

398+

expectCommandOptions(commitmentsListCommand, {

399+

json: true,

400+

agent: "work",

401+

status: "snoozed",

402+

all: false,

403+

});

437404

});

438405439406

it("runs commitments dismiss with id forwarding", async () => {

440407

await runCli(["commitments", "dismiss", "cm_1", "cm_2"]);

441408442-

expect(commitmentsDismissCommand).toHaveBeenCalledWith(

443-

expect.objectContaining({

444-

ids: ["cm_1", "cm_2"],

445-

}),

446-

runtime,

447-

);

409+

expectCommandOptions(commitmentsDismissCommand, {

410+

ids: ["cm_1", "cm_2"],

411+

});

448412

});

449413450414

it("does not register the legacy top-level flows command", () => {