Skip to content

Commit 743c984

Browse files
committed
fix: enforce exact skill paths for all skill matches
1 parent 09d4896 commit 743c984

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,7 @@ Docs: https://docs.openclaw.ai
13971397
- Gateway/plugins: enable the native `require()` fast path on Windows for bundled plugin modules so plugin loading uses `require()` instead of Jiti's transform pipeline, reducing startup from ~39s to ~2s on typical 6-plugin setups. Fixes #68656. (#74173) Thanks @galiniliev.
13981398
- macOS app: detect stale Gateway TLS certificate pins, automatically repair trusted Tailscale Serve rotations, and surface paired-but-disconnected Mac companion nodes so partial Gateway connections no longer look healthy. Thanks @guti.
13991399
- Feishu: recreate WebSocket clients with monitor-owned backoff only after SDK reconnect exhaustion, preserving heartbeat defaults and shutdown cleanup without treating recoverable SDK callback errors as terminal, so persistent connections recover without manual gateway restart. Fixes #52618; duplicate evidence #59753; related #55532, #68766, #72411, and #73739. Thanks @vincentkoc, @schumilin, @alex-xuweilong, @120106835, @sirfengyu, and @tianhaocui.
1400+
- Agents/skills: require exact `<location>` skill paths for both single-skill and multi-skill prompt selection, so agents do not guess or hard-code skill file paths. (#74161) Thanks @lanzhi-lee.
14001401

14011402
## 2026.4.27
14021403

src/agents/system-prompt.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,10 @@ describe("buildAgentSystemPrompt", () => {
458458
expect(prompt).toContain("- Read: Read file contents");
459459
expect(prompt).toContain("- Exec: Run shell commands");
460460
expect(prompt).toContain(
461-
"- If exactly one skill clearly applies: read its SKILL.md at <location> with `Read`, then follow it.",
461+
"- If exactly one skill clearly applies: read its SKILL.md at <location> with `Read`, then follow it. You MUST use the exact <location> value from <available_skills>; never guess, fabricate, or hard-code a skill file path.",
462+
);
463+
expect(prompt).toContain(
464+
"- If multiple could apply: choose the most specific one, read its SKILL.md at <location> with `Read`, then follow it. You MUST use the exact <location> value from <available_skills>; never guess, fabricate, or hard-code a skill file path.",
462465
);
463466
expect(prompt).toContain("OpenClaw docs: /tmp/openclaw/docs");
464467
expect(prompt).toContain(
@@ -644,7 +647,10 @@ describe("buildAgentSystemPrompt", () => {
644647

645648
expect(prompt).toContain("## Skills");
646649
expect(prompt).toContain(
647-
"- If exactly one skill clearly applies: read its SKILL.md at <location> with `read`, then follow it.",
650+
"- If exactly one skill clearly applies: read its SKILL.md at <location> with `read`, then follow it. You MUST use the exact <location> value from <available_skills>; never guess, fabricate, or hard-code a skill file path.",
651+
);
652+
expect(prompt).toContain(
653+
"- If multiple could apply: choose the most specific one, read its SKILL.md at <location> with `read`, then follow it. You MUST use the exact <location> value from <available_skills>; never guess, fabricate, or hard-code a skill file path.",
648654
);
649655
});
650656

src/agents/system-prompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function buildSkillsSection(params: { skillsPrompt?: string; readToolName: strin
203203
"## Skills (mandatory)",
204204
"Before replying: scan <available_skills> <description> entries.",
205205
`- If exactly one skill clearly applies: read its SKILL.md at <location> with \`${params.readToolName}\`, then follow it. You MUST use the exact <location> value from <available_skills>; never guess, fabricate, or hard-code a skill file path.`,
206-
"- If multiple could apply: choose the most specific one, then read/follow it.",
206+
`- If multiple could apply: choose the most specific one, read its SKILL.md at <location> with \`${params.readToolName}\`, then follow it. You MUST use the exact <location> value from <available_skills>; never guess, fabricate, or hard-code a skill file path.`,
207207
"- If none clearly apply: do not read any SKILL.md.",
208208
"Constraints: never read more than one skill up front; only read after selecting.",
209209
"- When a skill drives external API writes, assume rate limits: prefer fewer larger writes, avoid tight one-item loops, serialize bursts when possible, and respect 429/Retry-After.",

0 commit comments

Comments
 (0)