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

推荐订阅源

宝玉的分享
宝玉的分享
J
Java Code Geeks
S
SegmentFault 最新的问题
L
LangChain Blog
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
H
Help Net Security
阮一峰的网络日志
阮一峰的网络日志
Jina AI
Jina AI
N
Netflix TechBlog - Medium
A
About on SuperTechFans
博客园 - 叶小钗
美团技术团队
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net

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(skill-workshop): honor pending approval for tool sugg...
pgondhi987 · 2026-05-07 · via Recent Commits to openclaw:main

@@ -2,6 +2,7 @@ import fs from "node:fs/promises";

22

import os from "node:os";

33

import path from "node:path";

44

import type { AnyAgentTool } from "openclaw/plugin-sdk/agent-runtime";

5+

import type { PluginTrustedToolPolicyRegistration } from "openclaw/plugin-sdk/core";

56

import { createTestPluginApi } from "openclaw/plugin-sdk/plugin-test-api";

67

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

78

import plugin, {

@@ -617,6 +618,72 @@ describe("skill-workshop", () => {

617618

expect(await store.list("pending")).toHaveLength(1);

618619

});

619620621+

it("queues apply true suggestions in pending mode before explicit apply", async () => {

622+

const workspaceDir = await makeTempDir();

623+

const stateDir = await makeTempDir();

624+

let tool: AnyAgentTool | undefined;

625+

const api = createTestPluginApi({

626+

pluginConfig: { approvalPolicy: "pending" },

627+

runtime: {

628+

agent: {

629+

resolveAgentWorkspaceDir: () => workspaceDir,

630+

},

631+

state: {

632+

resolveStateDir: () => stateDir,

633+

},

634+

} as never,

635+

registerTool(registered) {

636+

const resolved =

637+

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

638+

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

639+

},

640+

});

641+642+

plugin.register(api);

643+

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

644+

action: "suggest",

645+

apply: true,

646+

skillName: "screenshot-asset-workflow",

647+

description: "Screenshot asset workflow",

648+

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

649+

});

650+651+

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

652+

const proposalId =

653+

(result?.details as { proposal?: { id?: string } } | undefined)?.proposal?.id ?? "";

654+

expect(proposalId).toBeTruthy();

655+

await expect(

656+

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

657+

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

658+

const store = new SkillWorkshopStore({ stateDir, workspaceDir });

659+

expect(await store.list("pending")).toHaveLength(1);

660+

expect(await store.list("applied")).toHaveLength(0);

661+

});

662+663+

it("requires operator approval before applying queued proposals in pending mode", async () => {

664+

let trustedPolicy: PluginTrustedToolPolicyRegistration | undefined;

665+

const api = createTestPluginApi({

666+

pluginConfig: { approvalPolicy: "pending" },

667+

registerTrustedToolPolicy(policy) {

668+

trustedPolicy = policy;

669+

},

670+

});

671+672+

plugin.register(api);

673+674+

const result = await trustedPolicy?.evaluate(

675+

{ toolName: "skill_workshop", params: { action: "apply", id: "proposal-1" } },

676+

{ toolName: "skill_workshop" },

677+

);

678+679+

expect(result).toMatchObject({

680+

requireApproval: {

681+

title: "Apply workspace skill proposal",

682+

allowedDecisions: ["allow-once", "deny"],

683+

},

684+

});

685+

});

686+620687

it("uses the reviewer to propose existing skill repairs", async () => {

621688

const workspaceDir = await makeTempDir();

622689

const stateDir = await makeTempDir();