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

推荐订阅源

博客园 - 叶小钗
爱范儿
爱范儿
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
博客园 - 聂微东
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
罗磊的独立博客
Jina AI
Jina AI

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(hooks): respect live skill workshop config · openclaw...
vincentkoc · 2026-04-23 · via Recent Commits to openclaw:main

@@ -213,6 +213,117 @@ describe("skill-workshop", () => {

213213

});

214214

});

215215216+

it("uses live runtime config for prompt-build guidance enablement", async () => {

217+

let configFile: Record<string, unknown> = {

218+

plugins: {

219+

entries: {

220+

"skill-workshop": {

221+

config: {

222+

approvalPolicy: "auto",

223+

},

224+

},

225+

},

226+

},

227+

};

228+

const on = vi.fn();

229+

const api = createTestPluginApi({

230+

pluginConfig: { approvalPolicy: "auto" },

231+

runtime: {

232+

config: {

233+

loadConfig: () => configFile,

234+

},

235+

} as never,

236+

on,

237+

});

238+239+

plugin.register(api);

240+241+

const hook = on.mock.calls.find((call) => call[0] === "before_prompt_build")?.[1];

242+

expect(hook).toBeTypeOf("function");

243+244+

configFile = {

245+

plugins: {

246+

entries: {

247+

"skill-workshop": {

248+

config: {

249+

enabled: false,

250+

},

251+

},

252+

},

253+

},

254+

};

255+256+

await expect(hook?.({}, {})).resolves.toBeUndefined();

257+

});

258+259+

it("uses live runtime config for tool approval policy", async () => {

260+

const workspaceDir = await makeTempDir();

261+

const stateDir = await makeTempDir();

262+

let configFile: Record<string, unknown> = {

263+

plugins: {

264+

entries: {

265+

"skill-workshop": {

266+

config: {

267+

approvalPolicy: "pending",

268+

},

269+

},

270+

},

271+

},

272+

};

273+

let tool: AnyAgentTool | undefined;

274+

let toolFactory:

275+

| ((ctx: { workspaceDir?: string }) => AnyAgentTool | AnyAgentTool[] | null | undefined)

276+

| undefined;

277+

const api = createTestPluginApi({

278+

pluginConfig: { approvalPolicy: "pending" },

279+

runtime: {

280+

agent: {

281+

resolveAgentWorkspaceDir: () => workspaceDir,

282+

},

283+

state: {

284+

resolveStateDir: () => stateDir,

285+

},

286+

config: {

287+

loadConfig: () => configFile,

288+

},

289+

} as never,

290+

registerTool(registered) {

291+

toolFactory = typeof registered === "function" ? registered : undefined;

292+

const resolved =

293+

typeof registered === "function" ? registered({ workspaceDir }) : registered;

294+

tool = Array.isArray(resolved) ? resolved[0] : (resolved ?? undefined);

295+

},

296+

});

297+298+

plugin.register(api);

299+300+

configFile = {

301+

plugins: {

302+

entries: {

303+

"skill-workshop": {

304+

config: {

305+

approvalPolicy: "auto",

306+

},

307+

},

308+

},

309+

},

310+

};

311+

const refreshedTool = toolFactory?.({ workspaceDir });

312+

tool = Array.isArray(refreshedTool) ? refreshedTool[0] : (refreshedTool ?? undefined);

313+314+

const result = await tool?.execute?.("call-1", {

315+

action: "suggest",

316+

skillName: "screenshot-asset-workflow",

317+

description: "Screenshot asset workflow",

318+

body: "Verify dimensions, optimize the PNG, and run the relevant gate.",

319+

});

320+321+

expect(result?.details).toMatchObject({ status: "applied" });

322+

await expect(

323+

fs.access(path.join(workspaceDir, "skills", "screenshot-asset-workflow", "SKILL.md")),

324+

).resolves.toBeUndefined();

325+

});

326+216327

it("skips agent_end hook wiring when auto-capture is disabled", () => {

217328

const on = vi.fn();

218329

const api = createTestPluginApi({

@@ -226,6 +337,77 @@ describe("skill-workshop", () => {

226337

expect(on).not.toHaveBeenCalledWith("agent_end", expect.any(Function));

227338

});

228339340+

it("uses live runtime config to skip capture when review mode turns off", async () => {

341+

const workspaceDir = await makeTempDir();

342+

const stateDir = await makeTempDir();

343+

let configFile: Record<string, unknown> = {

344+

plugins: {

345+

entries: {

346+

"skill-workshop": {

347+

config: {

348+

approvalPolicy: "auto",

349+

reviewMode: "hybrid",

350+

},

351+

},

352+

},

353+

},

354+

};

355+

const logger = { info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() };

356+

const on = vi.fn();

357+

const api = createTestPluginApi({

358+

pluginConfig: { approvalPolicy: "auto", reviewMode: "hybrid" },

359+

logger,

360+

runtime: {

361+

agent: {

362+

resolveAgentWorkspaceDir: () => workspaceDir,

363+

},

364+

state: {

365+

resolveStateDir: () => stateDir,

366+

},

367+

config: {

368+

loadConfig: () => configFile,

369+

},

370+

} as never,

371+

on,

372+

});

373+374+

plugin.register(api);

375+376+

configFile = {

377+

plugins: {

378+

entries: {

379+

"skill-workshop": {

380+

config: {

381+

approvalPolicy: "auto",

382+

reviewMode: "off",

383+

},

384+

},

385+

},

386+

},

387+

};

388+389+

const handler = on.mock.calls.find((call) => call[0] === "agent_end")?.[1];

390+

expect(handler).toBeTypeOf("function");

391+

await handler?.(

392+

{

393+

success: true,

394+

messages: [

395+

{

396+

role: "user",

397+

content:

398+

"From now on when asked for animated GIFs, verify the file is actually animated.",

399+

},

400+

],

401+

},

402+

{ workspaceDir },

403+

);

404+405+

await expect(

406+

fs.access(path.join(workspaceDir, "skills", "animated-gif-workflow", "SKILL.md")),

407+

).rejects.toMatchObject({ code: "ENOENT" });

408+

expect(logger.info).not.toHaveBeenCalledWith("skill-workshop: applied animated-gif-workflow");

409+

});

410+229411

it("skips agent_end hook wiring when review mode is off", () => {

230412

const on = vi.fn();

231413

const api = createTestPluginApi({