fix: align empty default skill filter behavior · openclaw/openclaw@c46ca5d
shakkernerd
·
2026-05-30
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -57,6 +57,33 @@ describe("SkillsService", () => {
|
57 | 57 | expect(fromConfig).toMatchObject({ prompt: "", skills: [], resolvedSkills: [], version: 12 }); |
58 | 58 | }); |
59 | 59 | |
| 60 | +it("does not apply default skill filters without an agent id", async () => { |
| 61 | +const workspaceDir = await makeTempWorkspace(); |
| 62 | +await writeWorkspaceSkills(workspaceDir, [ |
| 63 | +{ name: "service-default-filter", description: "Default filter workflow" }, |
| 64 | +]); |
| 65 | +const roots = isolatedSkillRoots(workspaceDir); |
| 66 | +const config = { |
| 67 | +agents: { defaults: { skills: [] } }, |
| 68 | +} satisfies OpenClawConfig; |
| 69 | + |
| 70 | +const actual = buildWorkspaceSkillSnapshot(workspaceDir, { |
| 71 | + ...roots, |
| 72 | + config, |
| 73 | +snapshotVersion: 13, |
| 74 | +}); |
| 75 | +const expected = buildLegacyWorkspaceSkillSnapshot(workspaceDir, { |
| 76 | + ...roots, |
| 77 | + config, |
| 78 | +snapshotVersion: 13, |
| 79 | +}); |
| 80 | + |
| 81 | +expect(actual.prompt).toBe(expected.prompt); |
| 82 | +expect(actual.skills).toEqual(expected.skills); |
| 83 | +expect(actual.resolvedSkills).toEqual(expected.resolvedSkills); |
| 84 | +expect(actual.skills.map((skill) => skill.name)).toContain("service-default-filter"); |
| 85 | +}); |
| 86 | + |
60 | 87 | it("builds snapshots from the index without changing prompt output", async () => { |
61 | 88 | const workspaceDir = await makeTempWorkspace(); |
62 | 89 | await writeWorkspaceSkills(workspaceDir, [ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。