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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
美团技术团队
腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
aimingoo的专栏
aimingoo的专栏
博客园_首页
V
V2EX
Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss

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: tighten skills status assertions · openclaw/opencla...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -3,6 +3,8 @@ import { buildWorkspaceSkillStatus } from "./skills-status.js";

33

import { createCanonicalFixtureSkill } from "./skills.test-helpers.js";

44

import type { SkillEntry } from "./skills/types.js";

556+

type SkillStatus = ReturnType<typeof buildWorkspaceSkillStatus>["skills"][number];

7+68

describe("buildWorkspaceSkillStatus", () => {

79

it("does not surface install options for OS-scoped skills on unsupported platforms", () => {

810

if (process.platform === "win32") {

@@ -157,18 +159,9 @@ describe("buildWorkspaceSkillStatus", () => {

157159

expect(report.agentId).toBe("specialist");

158160

expect(report.agentSkillFilter).toEqual(["alpha"]);

159161

expect(report.skills.find((skill) => skill.name === "alpha")?.blockedByAgentFilter).toBe(false);

160-

expect(report.skills).toContainEqual(

161-

expect.objectContaining({

162-

name: "alpha",

163-

modelVisible: true,

164-

}),

165-

);

166-

expect(report.skills).toContainEqual(

167-

expect.objectContaining({

168-

name: "beta",

169-

blockedByAgentFilter: true,

170-

}),

171-

);

162+

const byName = skillStatusByName(report.skills);

163+

expect(requireSkillStatus(byName, "alpha").modelVisible).toBe(true);

164+

expect(requireSkillStatus(byName, "beta").blockedByAgentFilter).toBe(true);

172165

expect(report.skills.find((skill) => skill.name === "beta")?.modelVisible).toBe(false);

173166

});

174167

@@ -241,7 +234,7 @@ describe("buildWorkspaceSkillStatus", () => {

241234

],

242235

});

243236244-

const byName = new Map(report.skills.map((skill) => [skill.name, skill]));

237+

const byName = skillStatusByName(report.skills);

245238

expect(report.agentSkillFilter).toEqual([

246239

"ready",

247240

"needs-bin",

@@ -251,61 +244,103 @@ describe("buildWorkspaceSkillStatus", () => {

251244

"disabled",

252245

"bundled-blocked",

253246

]);

254-

expect(byName.get("ready")).toMatchObject({

247+

expectStatusFlags(requireSkillStatus(byName, "ready"), {

255248

eligible: true,

256249

modelVisible: true,

257250

commandVisible: true,

258251

});

259-

expect(byName.get("needs-bin")).toMatchObject({

252+

const needsBin = requireSkillStatus(byName, "needs-bin");

253+

expectStatusFlags(needsBin, {

260254

eligible: false,

261255

modelVisible: false,

262256

commandVisible: false,

263-

missing: { bins: [missingBin] },

264-

install: [

265-

{

266-

kind: "node",

267-

label: "Install @openclaw/missing-skill-bin (pnpm)",

268-

bins: [missingBin],

269-

},

270-

],

271257

});

272-

expect(byName.get("needs-env")).toMatchObject({

273-

eligible: false,

274-

primaryEnv: "OPENCLAW_TEST_MISSING_SKILL_KEY",

275-

missing: { env: ["OPENCLAW_TEST_MISSING_SKILL_KEY"] },

258+

expect(needsBin.missing).toStrictEqual({

259+

anyBins: [],

260+

bins: [missingBin],

261+

config: [],

262+

env: [],

263+

os: [],

276264

});

277-

expect(byName.get("prompt-hidden")).toMatchObject({

265+

expect(needsBin.install).toStrictEqual([

266+

{

267+

kind: "node",

268+

id: "node-0",

269+

label: "Install @openclaw/missing-skill-bin (pnpm)",

270+

bins: [missingBin],

271+

},

272+

]);

273+

const needsEnv = requireSkillStatus(byName, "needs-env");

274+

expect(needsEnv.eligible).toBe(false);

275+

expect(needsEnv.primaryEnv).toBe("OPENCLAW_TEST_MISSING_SKILL_KEY");

276+

expect(needsEnv.missing).toStrictEqual({

277+

anyBins: [],

278+

bins: [],

279+

config: [],

280+

env: ["OPENCLAW_TEST_MISSING_SKILL_KEY"],

281+

os: [],

282+

});

283+

expectStatusFlags(requireSkillStatus(byName, "prompt-hidden"), {

278284

eligible: true,

279285

modelVisible: false,

280286

commandVisible: true,

281287

});

282-

expect(byName.get("slash-hidden")).toMatchObject({

288+

const slashHidden = requireSkillStatus(byName, "slash-hidden");

289+

expectStatusFlags(slashHidden, {

283290

eligible: true,

284291

modelVisible: true,

285-

userInvocable: false,

286292

commandVisible: false,

287293

});

288-

expect(byName.get("agent-filtered")).toMatchObject({

294+

expect(slashHidden.userInvocable).toBe(false);

295+

const agentFiltered = requireSkillStatus(byName, "agent-filtered");

296+

expectStatusFlags(agentFiltered, {

289297

eligible: true,

290-

blockedByAgentFilter: true,

291298

modelVisible: false,

292299

commandVisible: false,

293300

});

294-

expect(byName.get("disabled")).toMatchObject({

301+

expect(agentFiltered.blockedByAgentFilter).toBe(true);

302+

const disabled = requireSkillStatus(byName, "disabled");

303+

expectStatusFlags(disabled, {

295304

eligible: false,

296-

disabled: true,

297305

modelVisible: false,

298306

commandVisible: false,

299307

});

300-

expect(byName.get("bundled-blocked")).toMatchObject({

308+

expect(disabled.disabled).toBe(true);

309+

const bundledBlocked = requireSkillStatus(byName, "bundled-blocked");

310+

expectStatusFlags(bundledBlocked, {

301311

eligible: false,

302-

blockedByAllowlist: true,

303312

modelVisible: false,

304313

commandVisible: false,

305314

});

315+

expect(bundledBlocked.blockedByAllowlist).toBe(true);

306316

});

307317

});

308318319+

function skillStatusByName(skills: readonly SkillStatus[]): Map<string, SkillStatus> {

320+

return new Map(skills.map((skill) => [skill.name, skill]));

321+

}

322+323+

function requireSkillStatus(byName: ReadonlyMap<string, SkillStatus>, name: string): SkillStatus {

324+

const status = byName.get(name);

325+

if (!status) {

326+

throw new Error(`expected skill status ${name}`);

327+

}

328+

return status;

329+

}

330+331+

function expectStatusFlags(

332+

status: SkillStatus,

333+

expected: {

334+

eligible: boolean;

335+

modelVisible: boolean;

336+

commandVisible: boolean;

337+

},

338+

): void {

339+

expect(status.eligible).toBe(expected.eligible);

340+

expect(status.modelVisible).toBe(expected.modelVisible);

341+

expect(status.commandVisible).toBe(expected.commandVisible);

342+

}

343+309344

function createEntry(

310345

name: string,

311346

params: {