mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
tests/docs: cover diffs skill loading behavior
This commit is contained in:
@@ -16,6 +16,8 @@ The tool can return:
|
||||
- `details.filePath`: a local rendered artifact path when file rendering is requested
|
||||
- `details.fileFormat`: the rendered file format (`png` or `pdf`)
|
||||
|
||||
When the plugin is enabled, it also ships a companion skill from `skills/` that guides when to use `diffs`. This guidance is delivered through normal skill loading, not unconditional prompt-hook injection on every turn.
|
||||
|
||||
This means an agent can:
|
||||
|
||||
- call `diffs` with `mode=view`, then pass `details.viewerUrl` to `canvas present`
|
||||
|
||||
@@ -139,4 +139,20 @@ describe("loadWorkspaceSkillEntries", () => {
|
||||
|
||||
expect(entries.map((entry) => entry.skill.name)).toContain("diffs");
|
||||
});
|
||||
|
||||
it("excludes diffs plugin skill when the plugin is disabled", async () => {
|
||||
const { workspaceDir, managedDir, bundledDir } = await setupWorkspaceWithDiffsPlugin();
|
||||
|
||||
const entries = loadWorkspaceSkillEntries(workspaceDir, {
|
||||
config: {
|
||||
plugins: {
|
||||
entries: { diffs: { enabled: false } },
|
||||
},
|
||||
},
|
||||
managedSkillsDir: managedDir,
|
||||
bundledSkillsDir: bundledDir,
|
||||
});
|
||||
|
||||
expect(entries.map((entry) => entry.skill.name)).not.toContain("diffs");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user