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

推荐订阅源

月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
T
Tailwind CSS Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
博客园 - 聂微东
V
Visual Studio Blog
博客园_首页
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
F
Fortinet All Blogs
C
Check Point Blog
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More

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
Keep core doctor health in contribution order (#86627) · ...
giodl73-repo · 2026-06-21 · via Recent Commits to openclaw:main

@@ -2,7 +2,7 @@

22

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

33

import type { OpenClawConfig } from "../config/types.openclaw.js";

44

import { resetCoreHealthChecksForTest } from "../flows/doctor-core-checks.js";

5-

import { clearHealthChecksForTest } from "../flows/health-check-registry.js";

5+

import { clearHealthChecksForTest, registerHealthCheck } from "../flows/health-check-registry.js";

66

import { runDoctorLintCli } from "./doctor-lint.js";

7788

const mocks = vi.hoisted(() => ({

@@ -192,6 +192,134 @@ describe("runDoctorLintCli", () => {

192192

}

193193

});

194194195+

it("runs core contribution checks plus registered extension checks", async () => {

196+

mocks.readConfigFileSnapshot.mockResolvedValue({

197+

exists: true,

198+

valid: true,

199+

config: {},

200+

path: "/tmp/openclaw.json",

201+

});

202+

registerHealthCheck({

203+

id: "plugin/example/lint",

204+

kind: "plugin",

205+

description: "example plugin lint check",

206+

async detect() {

207+

return [

208+

{

209+

checkId: "plugin/example/lint",

210+

severity: "info",

211+

message: "plugin finding",

212+

},

213+

];

214+

},

215+

});

216+217+

const stdout = vi.spyOn(process.stdout, "write").mockImplementation(() => true);

218+

try {

219+

const exitCode = await runDoctorLintCli(runtime, {

220+

json: true,

221+

onlyIds: ["core/doctor/final-config-validation", "plugin/example/lint"],

222+

});

223+224+

expect(exitCode).toBe(1);

225+

const payload = JSON.parse(String(stdout.mock.calls.at(-1)?.[0]));

226+

expect(payload.checksRun).toBe(2);

227+

expect(payload.findings).toEqual([

228+

{

229+

checkId: "plugin/example/lint",

230+

severity: "info",

231+

message: "plugin finding",

232+

},

233+

]);

234+

} finally {

235+

stdout.mockRestore();

236+

}

237+

});

238+239+

it("rejects extension checks that reuse ordered core check ids", async () => {

240+

mocks.readConfigFileSnapshot.mockResolvedValue({

241+

exists: true,

242+

valid: true,

243+

config: {},

244+

path: "/tmp/openclaw.json",

245+

});

246+

registerHealthCheck({

247+

id: "core/doctor/final-config-validation",

248+

kind: "plugin",

249+

description: "colliding plugin lint check",

250+

async detect() {

251+

return [];

252+

},

253+

});

254+255+

await expect(runDoctorLintCli(runtime, { json: true })).rejects.toThrow(

256+

"health check already registered: core/doctor/final-config-validation",

257+

);

258+

});

259+260+

it("rejects registered core-kind checks that reuse ordered core check ids", async () => {

261+

mocks.readConfigFileSnapshot.mockResolvedValue({

262+

exists: true,

263+

valid: true,

264+

config: {},

265+

path: "/tmp/openclaw.json",

266+

});

267+

registerHealthCheck({

268+

id: "core/doctor/final-config-validation",

269+

kind: "core",

270+

description: "colliding core-kind lint check",

271+

async detect() {

272+

return [];

273+

},

274+

});

275+276+

await expect(runDoctorLintCli(runtime, { json: true })).rejects.toThrow(

277+

"health check already registered: core/doctor/final-config-validation",

278+

);

279+

});

280+281+

it("rejects extension checks that claim unused reserved core doctor ids", async () => {

282+

mocks.readConfigFileSnapshot.mockResolvedValue({

283+

exists: true,

284+

valid: true,

285+

config: {},

286+

path: "/tmp/openclaw.json",

287+

});

288+

registerHealthCheck({

289+

id: "core/doctor/not-yet-owned",

290+

kind: "plugin",

291+

description: "reserved plugin lint check",

292+

async detect() {

293+

return [];

294+

},

295+

});

296+297+

await expect(runDoctorLintCli(runtime, { json: true })).rejects.toThrow(

298+

"health check already registered: core/doctor/not-yet-owned",

299+

);

300+

});

301+302+

it("rejects registered core-kind checks that claim unused reserved core doctor ids", async () => {

303+

mocks.readConfigFileSnapshot.mockResolvedValue({

304+

exists: true,

305+

valid: true,

306+

config: {},

307+

path: "/tmp/openclaw.json",

308+

});

309+

registerHealthCheck({

310+

id: "core/doctor/not-yet-owned",

311+

kind: "core",

312+

description: "reserved core-kind lint check",

313+

async detect() {

314+

return [];

315+

},

316+

});

317+318+

await expect(runDoctorLintCli(runtime, { json: true })).rejects.toThrow(

319+

"health check already registered: core/doctor/not-yet-owned",

320+

);

321+

});

322+195323

it("rejects invalid severity thresholds", async () => {

196324

await expect(runDoctorLintCli(runtime, { severityMin: "warnng" })).rejects.toThrow(

197325

"Invalid --severity-min value",