diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d1375eaa32..545cfd0bbd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1398,6 +1398,7 @@ Docs: https://docs.openclaw.ai - 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. - 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. - 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. +- Agents/skills: require exact `` 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. ## 2026.4.27 diff --git a/src/agents/system-prompt.test.ts b/src/agents/system-prompt.test.ts index 0a36cbca762..73cef69d7f3 100644 --- a/src/agents/system-prompt.test.ts +++ b/src/agents/system-prompt.test.ts @@ -458,7 +458,10 @@ describe("buildAgentSystemPrompt", () => { expect(prompt).toContain("- Read: Read file contents"); expect(prompt).toContain("- Exec: Run shell commands"); expect(prompt).toContain( - "- If exactly one skill clearly applies: read its SKILL.md at with `Read`, then follow it.", + "- If exactly one skill clearly applies: read its SKILL.md at with `Read`, then follow it. You MUST use the exact value from ; never guess, fabricate, or hard-code a skill file path.", + ); + expect(prompt).toContain( + "- If multiple could apply: choose the most specific one, read its SKILL.md at with `Read`, then follow it. You MUST use the exact value from ; never guess, fabricate, or hard-code a skill file path.", ); expect(prompt).toContain("OpenClaw docs: /tmp/openclaw/docs"); expect(prompt).toContain( @@ -644,7 +647,10 @@ describe("buildAgentSystemPrompt", () => { expect(prompt).toContain("## Skills"); expect(prompt).toContain( - "- If exactly one skill clearly applies: read its SKILL.md at with `read`, then follow it.", + "- If exactly one skill clearly applies: read its SKILL.md at with `read`, then follow it. You MUST use the exact value from ; never guess, fabricate, or hard-code a skill file path.", + ); + expect(prompt).toContain( + "- If multiple could apply: choose the most specific one, read its SKILL.md at with `read`, then follow it. You MUST use the exact value from ; never guess, fabricate, or hard-code a skill file path.", ); }); diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 9d87d2a2b3f..1078c7057ed 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -202,8 +202,8 @@ function buildSkillsSection(params: { skillsPrompt?: string; readToolName: strin return [ "## Skills (mandatory)", "Before replying: scan entries.", - `- If exactly one skill clearly applies: read its SKILL.md at with \`${params.readToolName}\`, then follow it.`, - "- If multiple could apply: choose the most specific one, then read/follow it.", + `- If exactly one skill clearly applies: read its SKILL.md at with \`${params.readToolName}\`, then follow it. You MUST use the exact value from ; never guess, fabricate, or hard-code a skill file path.`, + `- If multiple could apply: choose the most specific one, read its SKILL.md at with \`${params.readToolName}\`, then follow it. You MUST use the exact value from ; never guess, fabricate, or hard-code a skill file path.`, "- If none clearly apply: do not read any SKILL.md.", "Constraints: never read more than one skill up front; only read after selecting.", "- 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.",