Skip to content

Commit 19518d3

Browse files
committed
fix(skills): persist workshop apply reason and correct docs
1 parent 2d5dfe4 commit 19518d3

4 files changed

Lines changed: 54 additions & 20 deletions

File tree

‎docs/tools/self-learning.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ The foreground answer is never delayed for learning. A failed or ineligible
133133
turn does not start experience review, although direct user corrections can
134134
still be offered as a suggestion when autonomy is disabled.
135135

136+
## Runtime support
137+
138+
Delayed experience review requires the embedded runner inside a long-running
139+
Gateway. Sessions on CLI-backed agent runtimes, for example the Codex app-server
140+
harness used by `openai/*` models, fail closed and never schedule experience
141+
review. Deterministic correction capture and `/learn` still work on those
142+
runtimes.
143+
136144
## What the reviewer receives
137145

138146
The background reviewer receives only the current turn, starting at its most

‎docs/tools/skill-workshop.md‎

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ sidebarTitle: "Skill Workshop"
1010
---
1111

1212
Skill Workshop is OpenClaw's governed path for creating and updating workspace
13-
skills. Agents and operators never write `SKILL.md` directly through this
14-
path — they create a **proposal** (pending draft with content, target
15-
binding, scanner state, hashes, and rollback metadata) that becomes a live
16-
skill only when applied.
13+
skills. Through this path, agents and operators create a **proposal** (pending
14+
draft with content, target binding, scanner state, hashes, and rollback
15+
metadata) that becomes a live skill only when applied.
1716

1817
Skill Workshop writes workspace skills only. It never touches bundled,
1918
plugin, ClawHub, extra-root, managed, personal-agent, or system skills.
@@ -29,7 +28,9 @@ plugin, ClawHub, extra-root, managed, personal-agent, or system skills.
2928
- **No clobber:** create fails if the target skill already exists.
3029
- **Hash bound:** update proposals bind to the current target hash and go
3130
`stale` if the live skill changes before apply.
32-
- **Scanner gated:** apply reruns the security scanner before writing.
31+
- **Scanner gated:** apply reruns the security scanner before writing. Only
32+
critical findings block apply; warn-level findings remain visible but do not
33+
block it.
3334
- **Recoverable:** apply writes rollback metadata before touching live files.
3435
- **Consistent surfaces:** chat, CLI, and Gateway all call the same service.
3536

@@ -49,11 +50,11 @@ Only a `pending` proposal can be revised, applied, rejected, or quarantined.
4950
## Lifecycle curation
5051

5152
The Gateway tracks aggregate skill usage in the shared state database. Once a
52-
day, it reviews skills created and applied by Skill Workshop. Skills unused for
53-
more than 30 days become `stale`; after 90 days they become `archived` and are
54-
left out of new agent skill snapshots. Archived skill files remain unchanged on
55-
disk. Manually authored skills are never curated; only skills created by Skill
56-
Workshop proposals enter lifecycle curation.
53+
day, it reviews applied skills created through agent autocapture. Skills unused
54+
for more than 30 days become `stale`; after 90 days they become `archived` and
55+
are left out of new agent skill snapshots. Archived skill files remain
56+
unchanged on disk. Operator-created skills, including proposals created through
57+
the CLI or Gateway/Control UI, are treated as manual and never curated.
5758

5859
Pinned skills bypass lifecycle transitions. A stale skill returns to `active`
5960
after it is used and the next sweep runs. Archived skills return only through an
@@ -215,9 +216,9 @@ Other parameters apply depending on the action:
215216
| `reason` | `apply`, `reject`, `quarantine` | Optional |
216217
| `query`, `status`, `limit` | `list` | Filter/paginate; `limit` max 50, default 20 |
217218

218-
Agents must use `skill_workshop` for generated skill work. They must not
219-
create or change proposal files through `write`, `edit`, `exec`, shell
220-
commands, or direct filesystem operations.
219+
Agents must use `skill_workshop` for generated skill work and must not create or
220+
change skill or proposal files directly. This rule is advisory and
221+
prompt-enforced. A hard guard is not currently possible at the tool-policy seam.
221222

222223
<Note>
223224
`skill_workshop` is a built-in agent tool and is included in
@@ -372,13 +373,13 @@ Default state directory: `~/.openclaw`.
372373

373374
## Limits
374375

375-
| Limit | Value |
376-
| ------------------------------- | -------------------------------------------------------------------- |
377-
| Description | 160 bytes |
378-
| Proposal body | `skills.workshop.maxSkillBytes` (default 40,000; hard ceiling 1 MiB) |
379-
| Support files | 64 per proposal |
380-
| Support file size | 256 KiB each, 2 MiB total |
381-
| Pending + quarantined proposals | `skills.workshop.maxPending` per workspace (default 50) |
376+
| Limit | Value |
377+
| ------------------------------- | ---------------------------------------------------------------------------- |
378+
| Description | 160 bytes |
379+
| Proposal body | `skills.workshop.maxSkillBytes` (default 40,000; hard ceiling 200,000 bytes) |
380+
| Support files | 64 per proposal |
381+
| Support file size | 256 KiB each, 2 MiB total |
382+
| Pending + quarantined proposals | `skills.workshop.maxPending` per workspace (default 50) |
382383

383384
## Troubleshooting
384385

‎src/skills/workshop/service.test.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,30 @@ describe("skill workshop proposals", () => {
149149
expect((await inspectSkillProposal(proposal.record.id))?.record.status).toBe("applied");
150150
});
151151

152+
it("persists the reason when applying a proposal", async () => {
153+
const workspaceDir = await makeWorkspace();
154+
const proposal = await proposeCreateSkill({
155+
workspaceDir,
156+
name: "Reviewed Skill",
157+
description: "Proposal approved after review",
158+
content: "# Reviewed Skill\n\nUse the reviewed workflow.\n",
159+
});
160+
161+
const applied = await applySkillProposal({
162+
workspaceDir,
163+
proposalId: proposal.record.id,
164+
reason: " approved after operator review ",
165+
});
166+
167+
expect(applied.record.statusReason).toBe("approved after operator review");
168+
await expect(inspectSkillProposal(proposal.record.id)).resolves.toMatchObject({
169+
record: {
170+
status: "applied",
171+
statusReason: "approved after operator review",
172+
},
173+
});
174+
});
175+
152176
it.runIf(process.platform !== "win32")(
153177
"applies updates through opted-in trusted workspace skills symlink targets",
154178
async () => {

‎src/skills/workshop/service.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ export async function applySkillProposal(
613613
status: "applied",
614614
updatedAt: now,
615615
appliedAt: now,
616+
statusReason: normalizeOptionalString(input.reason),
616617
scan,
617618
};
618619
await updateSkillProposalRecord({

0 commit comments

Comments
 (0)