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

推荐订阅源

博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
腾讯CDC
J
Java Code Geeks
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
雷峰网
雷峰网
B
Blog RSS Feed
博客园_首页
量子位
F
Fortinet All Blogs
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point 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
perf: isolate doctor core check tests (#84493) · openclaw...
frankekn · 2026-05-21 · via Recent Commits to openclaw:main

@@ -0,0 +1,114 @@

1+

import { promises as fs } from "node:fs";

2+

import { tmpdir } from "node:os";

3+

import { join } from "node:path";

4+

import { afterEach, describe, expect, it } from "vitest";

5+

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

6+

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

7+

import type { HealthCheck } from "./health-checks.js";

8+9+

const runtime = { log() {}, error() {}, exit() {} };

10+11+

function getCheck(id: string): HealthCheck {

12+

const check = CORE_HEALTH_CHECKS.find((entry) => entry.id === id);

13+

if (!check) {

14+

throw new Error(`Missing health check ${id}`);

15+

}

16+

return check;

17+

}

18+19+

describe("doctor core skills readiness smoke", () => {

20+

let tmp: string | undefined;

21+22+

afterEach(async () => {

23+

if (tmp !== undefined) {

24+

await fs.rm(tmp, { recursive: true, force: true });

25+

tmp = undefined;

26+

}

27+

});

28+29+

it("detects and repairs a real unavailable workspace skill", async () => {

30+

tmp = await fs.mkdtemp(join(tmpdir(), "openclaw-health-skills-"));

31+

const skillDir = join(tmp, "skills", "missing-tool");

32+

await fs.mkdir(skillDir, { recursive: true });

33+

await fs.writeFile(

34+

join(skillDir, "SKILL.md"),

35+

`---

36+

name: missing-tool

37+

description: Missing tool

38+

metadata: '{"openclaw":{"requires":{"bins":["openclaw-test-missing-skill-bin"]}}}'

39+

---

40+41+

# Missing tool

42+

`,

43+

"utf-8",

44+

);

45+

const cfg: OpenClawConfig = {

46+

agents: {

47+

defaults: {

48+

workspace: tmp,

49+

skills: ["missing-tool"],

50+

},

51+

},

52+

};

53+

const check = getCheck("core/doctor/skills-readiness");

54+55+

const findings = await check.detect({

56+

mode: "lint",

57+

runtime,

58+

cfg,

59+

cwd: tmp,

60+

});

61+

expect(findings).toContainEqual(

62+

expect.objectContaining({

63+

checkId: "core/doctor/skills-readiness",

64+

severity: "warning",

65+

path: "skills.entries.missing-tool.enabled",

66+

}),

67+

);

68+

await expect(

69+

check.detect(

70+

{

71+

mode: "fix",

72+

runtime,

73+

cfg,

74+

cwd: tmp,

75+

},

76+

{ paths: ["skills.entries.other-tool.enabled"] },

77+

),

78+

).resolves.toEqual([]);

79+

await expect(

80+

check.detect(

81+

{

82+

mode: "fix",

83+

runtime,

84+

cfg,

85+

cwd: tmp,

86+

},

87+

{ paths: ["skills.entries.missing-tool.enabled"] },

88+

),

89+

).resolves.toContainEqual(

90+

expect.objectContaining({

91+

path: "skills.entries.missing-tool.enabled",

92+

}),

93+

);

94+95+

const repaired = await check.repair?.(

96+

{

97+

mode: "fix",

98+

runtime,

99+

cfg,

100+

cwd: tmp,

101+

},

102+

findings,

103+

);

104+

expect(repaired?.config?.skills?.entries?.["missing-tool"]).toEqual({ enabled: false });

105+

expect(repaired?.changes).toContain("Disabled unavailable skill missing-tool.");

106+

expect(repaired?.effects).toContainEqual(

107+

expect.objectContaining({

108+

kind: "config",

109+

action: "disable-skill",

110+

target: "skills.entries.missing-tool.enabled",

111+

}),

112+

);

113+

});

114+

});